What’s the difference between dependencies, devDependencies and peerDependencies in npm package.json file?

Summary of important behavior differences: dependencies are installed on both: npm install from a directory that contains package.json npm install $package on any other directory devDependencies are: also installed on npm install on a directory that contains package.json, unless you pass the –production flag (go upvote Gayan Charith’s answer), or if the NODE_ENV=production environment variable … Read more

Find the version of an installed npm package

Use npm list for local packages or npm list -g for globally installed packages. You can find the version of a specific package by passing its name as an argument. For example, npm list grunt will result in: projectName@projectVersion /path/to/project/folder └── grunt@0.4.1 Alternatively, you can just run npm list without passing a package name as … Read more

What is the –save option for npm install?

Update npm 5: As of npm 5.0.0, installed modules are added as a dependency by default, so the –save option is no longer needed. The other save options still exist and are listed in the documentation for npm install. Original answer: Before version 5, NPM simply installed a package under node_modules by default. When you … Read more

tech