加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

NPM不会安装模块依赖项

发布时间:2020-12-14 01:20:35 所属栏目:百科 来源:网络整理
导读:这是我的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",
这是我的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)显式地列出依赖关系作为第一级依赖。这需要你维护列表,但实际上它必须很少做。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读