save as dev dependency npm code example
Example 1: npm dev dependencies
# install as devDependency
npm install --save-dev
# install as normal dependency
npm install --save
# install all devDependencies listed in package.json
npm install --only=dev
# install all normal dependencies listed in package.json
npm install --only=prod
# or if NODE_ENV is set to production
npm install
Example 2: npm install dev dependencies
npm install --save-dev
Example 3: install dependencies npm
npm install