npm install 缺少模块 [英] npm install is missing modules

查看:93
本文介绍了npm install 缺少模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中运行 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

现在当我再次执行安装命令时,我得到了

Now when I do the install command again I get

Error: Cannot find module 'di'
    ...

当我安装 di 并再次运行安装命令时,我得到:

When I install di and run the install command again I get:

Error: Cannot find module 'log4js'

我认为这可能会持续很长时间.任何建议这里发生了什么以及如何解决这个问题?

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 was not一个选项,所以我遇到了 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆