简体   繁体   中英

Confused in starting a project in node.js with npm install

Hello I am just a noob and still learning. I have already downloaded and tried the chat tutorial of get-started part from socket.io . Now, I am again learning from another source. What's confusing me is that, do I always have to npm install in the beginning of every project after writing the dependencies in the package.json? Or is there any other way? I would be very glad if you could help me understand my confusion. Thank you!

Yes, before running, all dependencies must be installed. So you must run npm install .

When developing, you can use npm install --save <package_name> to install a dependency and automatically add it to package.json .

NPM means Node Package Manager. It is used to manage your dependencies to other node modules dynamically thanks to a configuration file called package.json . This way you can easily define the exact versions you need or a mask in order to always retrieve the stable ones for instance.

The command npm install allows to interpret your configuration file and then download the good versions (and this recursively).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM