且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

NPM 不安装模块依赖项

更新时间:2022-12-08 09:20:12

看起来您遇到了一个已经存在很长时间并且还没有解决方案的错误.npm 存储库中有几个针对此案例的未解决问题:

It looks like you hit a bug that has existed for quite a while and doesn't have solution yet. There are several open issues for this case in the npm repository:

  • npm install should recursively check/install dependencies https://github.com/npm/npm/issues/1341 (closed)
  • local private module dependencies https://github.com/npm/npm/issues/2442 (closed)

在第一个中,人们列出了您可以尝试的几种解决方法.

In the first one people list several workarounds that you may try.

另一种解决方案可能是(有点hackish)将依赖项明确列为第一级依赖项.这需要您维护列表,但实际上很少这样做.

An alternative solution may be (a little hackish) to explicitly list the dependencies as first level dependents. This requires you to maintain the list but practically it has to be done very infrequently.