npm install is not adding all dependencies

只谈情不闲聊 提交于 2021-01-29 07:30:53

问题


I issue npm install protractor.

Under /path/to/node_modules/protractor/node_modules, i was expecting all the internal dependencies of protractor npm. But i am seeing only one module, q.

However in /path/to/node_modules/protractor/package.json, i can see all dependencies of protractor listed as,

  "dependencies": {
    "adm-zip": "0.4.4",
    "glob": "~3.2",
    "jasmine": "2.3.2",
    "jasminewd2": "0.0.6",
    "lodash": "~2.4.1",
    ...................
}

Protractor module is versioned "3.0.0" and npm is versioned 3.3.12, node.js is versioned v5.1.0.

What has changed in these new versions? Since, all npm modules used to maintain their own dependency copies.


回答1:


npm 3 flattens the dependency tree, so you should see protractor's dependencies in /path/to/node_modules.

If you don't see them there, my first guess is that you might have an npm-shrinkwrap.json file that is preventing modules from being installed, so you could check for that.



来源:https://stackoverflow.com/questions/34439079/npm-install-is-not-adding-all-dependencies

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!