Changing the name of package.json in node.js

52
April 24, 2019, at 10:40 PM

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.

Answer 1

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.

READ ALSO
Error 404 when try to access the URL manually

Error 404 when try to access the URL manually

I am new to web-developmentWhen I run my project locally (webpack-dev-server) I can manually change url and see the particular component

29
Nodejs OPENSSH - Error: read ECONNRESET at TCP.onStreamRead

Nodejs OPENSSH - Error: read ECONNRESET at TCP.onStreamRead

In one nodejs script, I am using openssh to execute dos command from one windows server to another remote windows server

68
Puppeteer: Open a page, get the data, go back to the previous page, enter a new page to get data

Puppeteer: Open a page, get the data, go back to the previous page, enter a new page to get data

Getting data from 1 page is simple, but how to go back after getting data from first page, enter a new page, get data from that pageetc

48
Nodemon and babel-node restart multiple times

Nodemon and babel-node restart multiple times

I'm using nodemon with babel-node in development environmentI'm working on Windows 7 and every time I change my code, nodemon restart multiple times

46