简体   繁体   中英

Strange npm update behavior

I shall mention that, I am a newbie to Angular and NPM.

I have two projects, both are created using Angular-CLI. In one of them when I execute npm update --save the dependencies get updated (including @angular dependencies from ^5.2.0 to ^5.2.3 ) in package.json file, but in the other one nothing gets updated.

I shall mention that both projects reside in a single computer, and even the project whose package.json is not updated runs using Angular 5.2.3 (the files in /node_modules/@angular/... are from 5.2.3 version of Angular).

I even have tested ncu , but got same results.

I can not understand why one project dependencies gets updated, but other ones does not.

You are only updating the package.json of the actual project.

/node_modules/@angular/... are dependencies. The version there is from the included model.

The model have to update his dependencies if in the /node_modules/@angular/.../package.json should be an other version.

For Example: this is the package.json from angular: https://github.com/angular/angular/blob/master/package.json

they have to update there own project and after you have to update your project with npm update --save , if the package.json in the angular model should change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM