npm install NOT dowloading latest package

坚强是说给别人听的谎言 提交于 2020-01-04 05:38:13

问题


[context] I have a problem to use "npm install" command to update my package.json with latest dependencies.

I am running on a Jenkins slave with Multibranch Pipeline, not sure if this is the cause?

There is another post having a similar issue, but not been answered ... NPM package.json not updating after npm install

Here is my package.json

  "dependencies": {
    "@company/ai-integration-test": "^1.0.1-NIGHTLY",
    "@company/ai-portal": "^1.0.1-NIGHTLY",
    "@company/ai-portal-lambdas": "^1.0.1-NIGHTLY"
  }

Here is the result for "npm outdated" [What do I expect]
I would like to get my package.json by running some command if "npm install" is the correct command to use? Thanks a million !!


回答1:


delete your package-lock.json file.

and try npm install again.

But npm install will only update those packages which have "^" in their version, it means auto-update that particular package when you run npm install.




回答2:


I found npm update command helps me to update package.json to the latest available version. But not sure if I am doing the right things though ... inputs are still welcome !! TKS !!

[Final Answer]

It turns out the problem was caused by our company's IT firewall settings. The firewall intermittently forge SSL certificate for security reasons. When that happens, downloading latest package fails without giving error messages.




回答3:


some of those updates are the major release npm update won't update to the latest version.

The major release does not update in this way because they maybe introduce breaking changes. npm save you from that trouble

npm install -g npm-check-updates

then run it:

ncu -u

this will update all packages to the latest version in the package.json



来源:https://stackoverflow.com/questions/56437747/npm-install-not-dowloading-latest-package

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