Anything I try to do with NPM, I end up with npm ERR! Cannot find module './access-error.js'
. Help!
I first noticed it when trying to install vue-chartjs. I ran npm install vue-chartjs chart.js --save
like the docs said to do and got the 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 plete log of this run can be found in:
npm ERR! /Users/adamzerner/.npm/_logs/2019-03-12T23_56_46_114Z-debug.log
Then I tried installing chart.js
and vue-chartjs
individually, but it gives me the same error.
Then I googled the issue. I tried:
rm -rf node_modules
npm install
and it didn't work.
I tried reinstalling NPM and it didn't work. I tried removing NPM via sudo npm uninstall npm -g
and then planning on reinstalling it after, and it didn't work. Everything I do gives me the npm ERR! Cannot find module './access-error.js'
error.
Anything I try to do with NPM, I end up with npm ERR! Cannot find module './access-error.js'
. Help!
I first noticed it when trying to install vue-chartjs. I ran npm install vue-chartjs chart.js --save
like the docs said to do and got the 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 plete log of this run can be found in:
npm ERR! /Users/adamzerner/.npm/_logs/2019-03-12T23_56_46_114Z-debug.log
Then I tried installing chart.js
and vue-chartjs
individually, but it gives me the same error.
Then I googled the issue. I tried:
rm -rf node_modules
npm install
and it didn't work.
I tried reinstalling NPM and it didn't work. I tried removing NPM via sudo npm uninstall npm -g
and then planning on reinstalling it after, and it didn't work. Everything I do gives me the npm ERR! Cannot find module './access-error.js'
error.
3 Answers
Reset to default 8This problem sounds very similar to one I had a few weeks ago.
What worked for me was removing Node.js
from my Mac and reinstalling it, because installing Node.js
installs npm
as well.
Command used to remove Node.js: sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}
Then just reinstall Node.js and everything should work again!
Hope this helps!
Ran into the same issue. Was using Node v8.11.4
. Switched to Node v8.9.4
and it started working again...
Using NVM, I did the following:
nvm ls
nvm install <different version>
nvm alias default <different version>
Best guess is that it wasn't 8.11
specifically, but something with my particular installation was messed up and using a fresh install fixed it.
Not very satisfying. ¯\_(ツ)_/¯
I faced the same problem. Found that the node version is different.
Try the following:
1. nvm ls
2. nvm use <latest version available>
Now baam .. it works.