这是我的package.json的模块,我包括在父项目中:
{ "version": "0.0.1","name": "module-name","dependencies": { "express": "3.3.4","grunt": "0.4.1","grunt-contrib-compass": "0.4.0","grunt-contrib-copy": "0.4.1","grunt-contrib-cssmin": "0.4.1","grunt-contrib-jshint": "0.6.3","grunt-contrib-requirejs": "0.4.1","grunt-contrib-uglify": "0.2.2","grunt-contrib-watch": "0.5.1","grunt-express-server": "0.4.1","grunt-karma": "0.4.5","grunt-regex-replace": "0.2.5","request": "2.25.0" },"scripts": { "postinstall": "grunt install" } }
需要注意的是,这个模块包含在一个私人仓库,我包含在父package.json像:“module-name”:“git ssh:// git @ myserver:user / module-name.git”
它看起来像你打了一个已经存在了一段时间,没有解决方案的错误。在npm存储库中有这种情况的几个开放问题:
> npm install应该递归检查/安装依赖项https://github.com/isaacs/npm/issues/1341
>本地私有模块依赖关系https://github.com/isaacs/npm/issues/2442
在第一个人列出几个解决方法,你可以尝试。
一个替代解决方案可能是(有点hackish)显式地列出依赖关系作为第一级依赖。这需要你维护列表,但实际上它必须很少做。