简体   繁体   中英

How do i import a project using node.js npm install on a package.json?

I'm new to node.js and i have looked around about how to import a project from a package.json using node.js with command: npm install "package name"

I have downloaded the project but i can't get it to work.

Where do i find the package name?

What should i type in order for it to work?

Run the command npm install (without any arguments) in the directory where the package.json file is located. That will install ALL packages listed in package.json into a node_modules folder in the same directory.


Side note: When you start developing the project further and want to install new dependencies you can run npm install somepackagename --save and that will install the package into node_modules as well as adding a line into the package.json file, specifying which name and version of the package that was installed.

The idea is that you can upload a project folder, without node_modules , and anyone can download your project and just run npm install to download all dependencies.

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