[英]Update package.json if local package version different
I am relatively new to node js, npm. 我对节点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.
看来我的系统上已安装哪些软件包与npm install / package.json正在安装哪些软件包之间存在差异。
Question: how can i check version of my local packages against my package.json and update my package.json accordingly. 问题:如何检查我的package.json本地软件包的版本并相应地更新package.json。 I have tried npm shrinkwrap but this generates a different file format.
我尝试过npmrinkwrap,但这会生成不同的文件格式。
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: 我想要实现的是使所有版本都与package.json中的本地版本匹配,如下所示:
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
进行依赖性
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.