简体   繁体   English

错误的ERR! 找不到模块'./access-error.js'

[英]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.jsvue-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.

相关问题 npm --version提供errormodule.js:538 throw err; ^错误:找不到模块 - npm --version is giving errormodule.js:538 throw err; ^ Error: Cannot find module npm-&gt;错误:找不到模块“可读流” - npm --> Err: Cannot find module 'readable-stream' 错误 [ERR_MODULE_NOT_FOUND]:找不到从 build\\server.js 导入的模块“build\\app” - Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'build\app' imported from build\server.js 内部/模块/cjs/loader.js:968 抛出错误; ^ 错误:找不到模块“../../temp” - internal/modules/cjs/loader.js:968 throw err; ^ Error: Cannot find module '../../temp' 表达 module.js:550 抛出错误; ^ 找不到模块 - Express module.js:550 throw err; ^ Cannot find module 使用Browserify构建npm-错误:找不到模块 - npm build with Browserify - Error: Cannot find module 打字稿/节点:错误 [ERR_MODULE_NOT_FOUND]:找不到模块 - Typescript/Node: Error [ERR_MODULE_NOT_FOUND]: Cannot find module 错误 [ERR_MODULE_NOT_FOUND]:找不到模块 - Error [ERR_MODULE_NOT_FOUND]: Cannot find module module.js:491 抛出错误; 错误:找不到模块“www/node-str/index.js” - module.js:491 throw err; Error: Cannot find module 'www/node-str/index.js' Vogels错误:错误:找不到模块&#39;./build/Release/DTraceProviderBindings&#39; - Vogels err: Error: Cannot find module './build/Release/DTraceProviderBindings'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM