npm install缺少模块 [英] npm install is missing modules
问题描述
在可以在项目中运行 gulp
之前,我需要运行 npm install
。除在我的计算机上之外,此方法均有效,因为出现以下错误:
Before I can run gulp
in my project I need to run npm install
. This works except on my computer, because I get the following error:
Error: Cannot find module 'socket.io'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
...
我可以使用
$> npm install socket.io
现在,当我再次执行install命令时,我会得到
Now when I do the install command again I get
Error: Cannot find module 'di'
...
当我安装 di
并再次运行install命令时,我得到:
When I install di
and run the install command again I get:
Error: Cannot find module 'log4js'
I认为这可能会持续很长时间。有什么建议吗?如何解决此问题?
I think that this might continue for a very long time. Any suggestions what is going on here and how to fix this ?
推荐答案
启动MEAN应用程序时,我也遇到了同样的问题并添加 npm install packageName --save
来添加每个缺少的依赖项,所以我遇到了 npm-install-missing 谁救了我的命:)
I've faced the same problem when bootstrapping a MEAN application and add each missing dependencie with npm install packageName --save
was not an option so I came across to npm-install-missing whom has saved my life :)
安装
npm install -g npm-install-missing
用法
npm-install-missing
这篇关于npm install缺少模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!