You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Go to your project directory
$ cd /path/to/your/project/directory
# Create the package.json file
$ npm init
# (OR) Create the package.json file without asking questions
$ npm init --yes
# Install a package as a dependency ("underscore" for example)# dependencies are packages required for the application to run# --save-prod flag is to add the package to your "dependencies" in the package.json file# you can ignore adding the --save-prod flag as it's the default
$ npm install underscore --save-prod
# (OR) Install a specific version of a package as a dependency # (version 1.8.2 of "underscore" for example)# --save-prod flag is to add the package to your "dependencies" in the package.json file# you can ignore adding the --save-prod flag as it's the default
$ npm install underscore@1.8.2--save-prod
# (OR) Install a package as a devDependency ("gulp" for example)# devDependencies are packages used for development purposes, # for example for running tests or transpiling code.# --save-dev flag is important if you want to add the package to your "devDependencies" in the package.json file
$ npm install gulp --save-dev
# Uninstall a package ("underscore" for example)# --save flag is important if you want to remove the package from your "dependencies" in the package.json file# --save-dev flag is important if you want to remove the package from your "devDependencies"
$ npm uninstall underscore --save
# List all installed packages
$ npm list
# Show which packages have updates and can be updated
$ npm outdated
# Update a package ("underscore" for example)
$ npm update underscore
# (OR) We can also execute `npm update` if we have many outdated modules we want to update
$ npm update
# Search for package ("underscore" for example)
$ npm search underscored