dependencies
key inside package.json
filenpm install
true
from NPM version 5.*npm install moment gulp
dependencies
but they will get put in their own object called devDependencies
npm install --save-dev gulp gulp-sass
dependencies
key if we run the command with --production
flagnpm install --production
NPM installs all modules listed inside dependencies
and devDependencies
npm install
gulp-sass
module
npm uninstall gulp-sass
npm un gulp-sass
npm remove gulp-sass
npm rm gulp-sass
All the above commands do the same thing (uninstalling the module)npm install moment@2.25.2
Installs the specified module with the latest patch
npm install moment@2.25
Installs the specified module with the latest minor
and patch
versions npm install moment@1
Installs the latest version of the module (with latest major
, minor
and patch
versions)npm install moment
minor
and patch
versions but do not update to the current major
versionnpm update moment
Before update""dependencies": {
"moment": "^1.6.2"
}
After update"dependencies": {
"moment": "^1.7.2"
}
The package updated to 1.7.2 even though the current major
version is 2
major
version will stick to 1
but minor
and patch
will be the latest versions"dependencies": {
"moment": "^1.6.2"
}
Only updates patch
but major
and minor
will be the specified versions"dependencies": {
"moment": "~1.6.2"
}
Exactly the specified version 1.6.2
will be installed"dependencies": {
"moment": "1.6.2"
}
The latest version of the package will be installed"dependencies": {
"moment": "*"
}
npm install nodemon -g / npm install -g nodemon