npm ERROR! The module './access-error.js' could not be located

I keep encountering an issue with NPM where I always get the error message

npm ERR! Cannot find module './access-error.js'
. Can anyone provide assistance?

The problem initially arose when attempting to install vue-chartjs. Following the documentation, I executed

npm install vue-chartjs chart.js --save
, only to receive the following error:

code/premium-poker-tools [master●] » npm install vue-chartjs chart.js --save
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module './access-error.js'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/adamzerner/.npm/_logs/2019-03-12T23_56_46_114Z-debug.log

Subsequently, I attempted installing chart.js and vue-chartjs separately, but encountered the same error.

After searching online for solutions, I followed recommendations such as this one:

rm -rf node_modules
npm install

Unfortunately, that did not resolve the issue.

I also tried re-installing NPM without success. Even after trying to remove NPM using sudo npm uninstall npm -g and planning to reinstall it afterwards, the persistent error remains:

npm ERR! Cannot find module './access-error.js'
.

Answer №1

This issue seems very much like a situation I encountered a few weeks back.

What resolved the problem for me was deleting Node.js from my Mac and then doing a fresh installation, as installing Node.js automatically includes npm.

To remove Node.js, I used the following command:

sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}

After that, just reinstall Node.js and everything should be back to normal!

Hopefully this solution works for you too!

Answer №2

Encountered a similar problem myself. I had been running Node v8.11.4, but after switching to Node v8.9.4, everything started functioning as expected once again.

Using NVM, I performed the following steps:

nvm ls 
nvm install <another version>
nvm alias default <another version>

I suspect that the issue wasn't necessarily with 8.11 specifically, but rather something was amiss in my existing installation. Reinstalling with a fresh setup seemed to resolve the issue.

A bit frustrating, but hey, it worked in the end. ¯\_(ツ)_/¯

Answer №3

Encountered a similar issue and discovered that the node version was the culprit. Here's what you can do: 1. nvm ls 2.

nvm use <latest version available>
Voila! Problem solved.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Expo React Native Month and Year Picker

Can anyone help me figure out how to create a date picker with just a month and year spinner, similar to the one used in LinkedIn job experiences? Are there any npm packages for Expo managed workflow or React Native that support this type of configuration ...

Can Regex expressions be utilized within the nodeJS aws sdk?

Running this AWS CLI command allows me to retrieve the correct images created within the past 45 days. aws ec2 describe-images --region us-east-1 --owners self -- query'Images[CreationDate<`2021-12-18`] | sort_by(@, &CreationDate)[].Name&apos ...

Having trouble accessing a JavaScript variable in Javascript due to reading null property 'value'

What I Require I am in need of passing a URL variable from an HTML document to a JavaScript file. HTML Snippet <script> var urlParam = "{{ page_param.asy_request | replace('&','&')}}"; urlParam = urlParam.rep ...

Proper management of setTimeout in an Angular application

I am working on a one-page web application where the main component's ngOnInit() function triggers a recursive function called loopDoSomething() using setTimeout: ngOnInit(): void { // Perform some operations this.loopDoSomething(); } loopDoSome ...

Solving the issue of 'b-modal' not appearing in a Vue.js custom component

Software Used: Vue.js Bootstrap-Vue () Issue: My aim is to show a popup when a row is clicked within a bootstrap grid. Once the modal is closed, I want it to disappear and the selected item to be removed. To tackle this problem, I have developed a custo ...

Mismatch of data types in Google Visualization

I am working with Google Visualization and receiving Unix Epoch timestamps that I need to convert into an array of strings for use in Google Charts. However, I keep encountering an error: Type mismatch. Value 2017-8-25 16:23:54,2017-8-25 16:11:54,... does ...

Tips for displaying and sorting two requests within one console

I am currently working on a project to display both folders and subfolders, but only the folders are visible at the moment. function getParserTypes (types, subject) { return types.map((type) => { return { id: type.entry.id, name: type. ...

Exploring the intricacies of initializing a JavaScript function

I recently inherited a large JavaScript file from a previous developer, and I'm trying to decipher some of the key sections. Here is the complete code: $(function () { var homepage = (function () { // Main functionalities are defined he ...

Using AngularJS routing with an Express 4.0 backend API

Recently, I began working on an application utilizing Express 4.0 server. Following a tutorial on scotch.io (http://scotch.io/tutorials/javascript/build-a-restful-api-using-node-and-express-4), I structured the routes to support a backend api serving an An ...

error encountered when installing npm proxy

After searching for solutions to this issue on various platforms such as Google and Stack Overflow, I have not been able to find the correct answer. The problem arises when running commands like npm install -g, resulting in errors similar to the following: ...

What is the best way to navigate through a complex array in React that includes objects and nested arrays?

I have been working on a JavaScript array that includes subobjects with arrays nested in them. My goal is to iterate through the entire parent object using React. Although I attempted the following approach, unfortunately it did not yield the desired outco ...

Top strategies for managing fixed datasets

Imagine having a dataset containing country names and their corresponding phone prefixes, like so: var countryPhonePrefixes = [ { 'name': 'Germany', 'prefix': '+49' }, { 'nam ...

The 'v-model' directive necessitates a valid attribute value for the left-hand side (LHS)

I am facing an issue with my Vue application. I have a table where each row has its own unique id. I need to show or hide certain elements based on a condition in the v-model directive which compares the row id with a value in the model. The current code s ...

Using Nest JS to create two instances of a single provider

While running a test suite, I noticed that there are two instances of the same provider alive - one for the implementation and another for the real implementation. I reached this conclusion because when I tried to replace a method with jest.fn call in my ...

Looking to organize data based on duplicate values within an array using Javascript in the Vue framework

Can anyone provide assistance? Data = [{"name":A,"val":20}, {"name":B,"val":7}, {"name":C,"val":20}, {"name":D,"val":8}, {"name":E,"val":5}] SortedValue ...

Understanding how events propagate in three.js

I am currently working on a scene that consists of multiple objects. To manipulate the selected object, I am using an orthographic camera controller. Specifically, I want to rotate the object with the mouse by pressing shiftKey + 1 (rotation around its own ...

Steps to displaying the result

new Vue({ data: { folders : [{ name : 'folder1', isActive : 1, }, { name : 'folder2', isActive : 0, }, ] } } }) Is there a way to access the active val ...

What are some effective methods for resetting a state in @ngrx/store?

Lately, I've been grappling with a problem that's been on my mind for the past few days. Our team is developing an Angular 2 application, and my task involves creating a wizard for users to complete a form. I've successfully set up the dat ...

The constant reloading of the page is hindering the crucial display of the data

After successfully getting something to work, I noticed that the data disappears when the page refreshes. How can I prevent this from happening? <html> <head> <meta charset="utf-8"> <title> IT Services </ti ...

Prevent clicking here

I'm attempting to only prevent the click event on the current item with a certain class. $(document).on('click', '.item', function() { $(".item").removeClass('is-expanded'); $(this).addClass('is-expanded'); ...