在使用 npm start
运行我的项目时,我一直遇到以下问题。即使在将我的 Node 版本降级到 8.4.0(npm 版本 5.3.0)后仍然遇到同样的问题。我知道在 stackoverflow 和 stackexchange 中存在相同的问题,并给出了很多解决方案。我尝试了所有方法,例如在删除 node_modules 以运行 npm cache clean --force
然后再次 npm install
之后,解决方案不起作用.我已经分享了下面的日志:
> subhojits-components@0.0.1 start
/home/subhojit/Desktop/myproject
> node server/index
Unspecified environment, booting dev server
Booting dev server....
module.js:491
throw err;
^
Error: Cannot find module 'internal/fs'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at evalmachine.<anonymous>:40:20
at Object.<anonymous> (/home/subhojit/Desktop/myproject/node_modules/express-handlebars/node_modules/graceful-fs/fs.js:11:1)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! subhojits-components@0.0.1 start: `node server/index`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the subhojits-components@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
注意:我使用的是 graceful-fs 4.1.15 版。
如有任何帮助,我们将不胜感激。
最佳答案
试试这个
sudo npm 缓存清理 -f
sudo npm install -g n
sudo n 稳定
关于javascript - 运行项目时出现 npm 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55917143/