I'm assuming that you have already installed the nodejs and npm. If not install
nodejs and npm it.
Create a package with npm
- When we run above command It will ask us a couple of questions about the package that we are going to create. After executing the command it will create a "package.json" file.
- We use "init" command only if we want to create a new package.
Installing global packages with npm
- we install a package globally only if we want to use it as a command line
- For example I you want to create a react native app we install react-native-cli globally. It provides "react-native" command we use it to create a react native package.
- If you are using ubuntu use the command "sudo npm install -g <package name>" Because it requires superuser permissions.
Installing local packages with npm
Uninstall a local package
Uninstall a global package
Search for a package
List all globally installed packages
List all locally installed packages
Setup for already existed package
npm install
- when you run above command it will install all packages(development packages and production) from "package.json" file.
command line
javascript
nodejs
npm