![]() You want to install those into dev dependencies and so for that you can use the -D flag and it will list that dependency in the dev dependencies section. Essentially what this does is things like test libraries-like Mocha or anything else-that are only going to be used if somebody is working on your module. So if we now look at this, we've got Underscore in our dependencies and Mocha is in our dev dependencies. If you use -d, the dependencies are going to get installed to the dev dependencies part of your packaged JSON. One other way to do things-and sort of another tip-is you can use simply npm i to install. Now that we've run this command, you can see if we open the node modules folder here, we've got Underscore installed and it's right there for us. What that means is that when somebody else downloads my project, they can simply run npm install without any arguments and using the package JSON dependencies listed, NPM will know exactly what to install. And what the -s is going to do is its going to make sure that dependency that we have just installed is now listed in this package.json file. The first thing we're going to install is Underscore, so I'm just going to say, "npm install -s_". Man 1: Now that we have our packaged JSON established, we can start actually installing some dependencies that we're going to use for our project.
0 Comments
Leave a Reply. |