[英]Changing the name of package.json in node.js
I would like to rename my node.js project. 我想重命名我的node.js项目。 According to this answer , all I had to do is change the value of the
name
property in package.json . 根据这个答案 ,我要做的就是更改package.json中
name
属性的值。
That said, the new version now includes package-lock.json . 也就是说,新版本现在包含package-lock.json 。 So is changing the name in package-lock.json , in addition to changing it in package.json , sufficient?
那么,除了在package.json中更改名称之外,更改package-lock.json中的名称是否足够? Do I have to change the name in another file?
我是否需要在另一个文件中更改名称?
Is there an npm command that I can run that applies the name change correctly and automatically updates it with all the naming rules verified? 我是否可以运行一个npm命令来正确应用名称更改,并在验证所有命名规则的情况下自动更新它?
Thanks. 谢谢。
If you change the name in package.json
, it must also be changed in package-lock.json
. 如果在
package.json
更改名称,则还必须在package-lock.json
更改package-lock.json
。 You can run npm install
to update package-lock.json
after changing the name
attribute in package.json
. 更改
package.json
的name
属性后,可以运行npm install
更新package-lock.json
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.