最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - npm ERR! Cannot find module '.access-error.js' - Stack Overflow

programmeradmin2浏览0评论

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.

Share Improve this question asked Mar 13, 2019 at 0:13 Adam ZernerAdam Zerner 19.3k17 gold badges101 silver badges172 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 8

This 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.

发布评论

评论列表(0)

  1. 暂无评论