When I try to install something with npm
it fails quite often (much more often that apt-get for example), and it will display "see log file for details" or "make in the directory failed". But when I try to inspect the directory said it will not be found. Does NPM simply delete every thing it just downloaded if anything fails during installation? Why would it tell me to check the directory then if it deleted it?
npm keeps downloaded packages as tarballs inside a cache folder.
see: https://www.npmjs.org/doc/cli/npm-cache.html
When you run npm install
and something goes wrong, it will try to undo and remove the packages from your current location, but it should leave the cached tarballs alone. Sometimes the cache can have a bad package-tarball.
You can force npm to install without using the cache like this npm install --force
. Or, if you really must, you can clear out the whole cache like this npm cache clean
.
Remember: npm installs packages into the current folder, or wherever your package.json can be found
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With