13

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.

1 Answer 1

25

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.