[英]npm ERR! Cannot find module './access-error.js'
Anything I try to do with NPM, I end up with npm ERR! Cannot find module './access-error.js'
我试图用NPM做的任何事情,我最终得到了
npm ERR! Cannot find module './access-error.js'
npm ERR! Cannot find module './access-error.js'
. npm ERR! Cannot find module './access-error.js'
。 Help! 救命!
I first noticed it when trying to install vue-chartjs . 我在尝试安装vue-chartjs时首先注意到了它。 I ran
npm install vue-chartjs chart.js --save
like the docs said to do and got the error: 我跑了
npm install vue-chartjs chart.js --save
像文件说的那样保存并得到错误:
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
Then I tried installing chart.js
and vue-chartjs
individually, but it gives me the same error. 然后我尝试单独安装
chart.js
和vue-chartjs
,但它给了我同样的错误。
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. 我尝试重新安装NPM,但它没有用。 I tried removing NPM via
sudo npm uninstall npm -g
and then planning on reinstalling it after, and it didn't work. 我尝试通过
sudo npm uninstall npm -g
删除 NPM,然后计划重新安装它,它不起作用。 Everything I do gives me the npm ERR! Cannot find module './access-error.js'
我所做的一切都给了我
npm ERR! Cannot find module './access-error.js'
npm ERR! Cannot find module './access-error.js'
error. npm ERR! Cannot find module './access-error.js'
错误。
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. 对我
Node.js
从我的Mac中删除Node.js
并重新安装它,因为安装Node.js
也会安装npm
。
Command used to remove Node.js: sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}
用于删除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! 然后只需重新安装Node.js,一切都应该再次运行!
Hope this helps! 希望这可以帮助!
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. 请尝试以下方法:
nvm ls
nvm use <latest version available>
现在baam ..它的工作原理。
Ran into the same issue. 陷入同样的问题。 Was using
Node v8.11.4
. 使用的是
Node v8.11.4
。 Switched to Node v8.9.4
and it started working again... 切换到
Node v8.9.4
并再次开始工作......
Using NVM, I did the following: 使用NVM,我做了以下事情:
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. 最好的猜测是它不是特别是
8.11
,但我的特定安装的东西搞砸了并使用全新安装修复它。
Not very satisfying. 不太满意。 ¯\\_(ツ)_/¯
¯\\ _(ツ)_ /¯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.