If you use npm install to install dependencies, first you must have the package.json configuration file. If not, you need to add the dependent installation package name later if you want to install dependencies -g is the global installation --save is a local installation
It is okay to add the package name, that is to install a specified package. If you do not add the package name, it is also a legal command. If you are in a project folder and there is a package.json file, dependency packages will be installed based on this file.
So make sure you have package.json first
Also, what is your npm version? If it is 5.x.x, take a look at this official issue: https://github.com/npm/npm/is...
If you use
npm install
to install dependencies, first you must have thepackage.json
configuration file. If not, you need to add the dependent installation package name later if you want to install dependencies-g
is the global installation--save
is a local installationIt is okay to add the package name, that is to install a specified package. If you do not add the package name, it is also a legal command. If you are in a project folder and there is a
package.json
file, dependency packages will be installed based on this file.So make sure you have
package.json
firstAlso, what is your npm version? If it is 5.x.x, take a look at this official issue: https://github.com/npm/npm/is...
1.npm install xxx:xxx adds the package;
2. The package.json file is configured in the current file directory
You need to add the package name after install