Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the name of package.json in node.js

I would like to rename my node.js project. According to this answer, all I had to do is change the value of the name property in package.json.

That said, the new version now includes package-lock.json. So is changing the name in package-lock.json, in addition to changing it in package.json, sufficient? 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?

Thanks.

like image 341
Greeso Avatar asked Dec 23 '22 23:12

Greeso


1 Answers

If you change the name in package.json, it must also be changed in package-lock.json. You can run npm install to update package-lock.json after changing the name attribute in package.json.

like image 175
programmer Avatar answered Dec 27 '22 22:12

programmer