Greeso
Greeso

Reputation: 8269

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.

Upvotes: 13

Views: 12629

Answers (1)

programmer
programmer

Reputation: 813

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.

Upvotes: 25

Related Questions