简体   繁体   中英

Update package.json if local package version different

I am relatively new to node js, npm. It seems there is a difference between what packages have been installed on my system and what packages are beeing installed by npm install/ package.json.

Question: how can i check version of my local packages against my package.json and update my package.json accordingly. I have tried npm shrinkwrap but this generates a different file format.

Current situation:

Gulp: 

local version 1.1 

global version 1.1

Package.json version 1.0

What i would like to achieve is for all versions to be matched to my local version in the package.json like this:

Gulp

Local version 1.1

Global version 1.1

P.json 1.1

Given there are thousands if not more packages im trying to use automation :)

使用npm update --save-dev进行更新并保存devDependencies,使用npm update --save进行依赖性

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