package.json dependencies code example
Example 1: npm dev dependencies
npm install <package-name> --save-dev
npm install <package-name> --save
npm install --only=dev
npm install --only=prod
npm install
Example 2: how to install dependencies from package.json
npm install // installs dependencies listed in package.json
Example 3: add dependencies to package.json
npm install <package-name> --save
npm install
Example 4: what are dependencies in package.json
dependencies are the modules that the project relies on to function properly.
Example 5: package.json files property local
"scripts": {
"postinstall": "node install.js"
},
"localDependencies": {
"ui-elements": "file:path/to/ui-elements"
},
"dependencies": {
"ui-elements": "git+https://[email protected]/user/ui-elements.git"
}