简体   繁体   中英

Why does NPM install another version then specified?

I worked on a project and pushed it to a bitbucket. After a needed format of my hdd I pulled the project back on my HDD. But when I do the npm install now it installs a different version then specified in the package.json package?

My package.json file

Output when npm finishes installing

Notice the react v15.5.4 in stead of the specified v15.3.2

NPM allows you to specify version with semantic versioning specification in which

"react": "^15.3.2",

means "every minor release of version 15"

Just remove the "^" symbol to install the version you need (or change to "~" if you want to accept patch releases)

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