I try to install node packeges with nmp. When i run, it says:
up to date, audited 356 packages in 7s
found 0 vulnerabilities
I see it as a dependency in my package-json like this:
"dependencies": {
"express": "*",
"nodemon": "*"
}
but there is no node_modules was installed..
Hope someone can help.
CodePudding user response:
These commands solve the same problem and have a look at the attached links.
https://github.com/npm/npm/issues/17282
Can't install anything using "npm install"
npm install -g npm
npm cache clean
npm update
npm install
CodePudding user response:
There are a few fixes to this issue.
The first one is to install the dependencies manually, as so.
$ npm install -s express nodemon
The command should install express
and nodemon
at the latest versions.
The second option is to run a few commands, as so (in the order given).
$ npm install -g npm
$ npm cache clean --force
$ npm update
$ npm install
Basically, these are what the commands do (from 1-4).
- This installs npm from npm (sounds weird, but there is an npm package).
- This command forcefully cleans out the cache of npm.
- As you can tell,
npm update
updates npm! - Finally, this command should be run in a directory where there is a
package.json
file. This installs all the dependencies listed inpackage.json
.
Don't type out the $ in the terminal examples!