After update npm i cannot use npm install
when i run
npm install
i've got
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module './lib/extract-stream.js'
The location of extract-stream.js
is /usr/local/lib/node_modules/npm/node_modules/pacote/lib/extract-stream.js
If i run
/usr/local/bin/npm install # IT WORKS!
when i run
which npm
# output: {my_home_path}/.npm-global/bin/npm
and when i run
npm -v
# output: 6.7.0
/usr/local/bin/npm -v
# output 6.5.0
How can i fix this issue?
If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).
To solve the Missing script: "start" error, make sure to add a start command to the scripts object in your package. json file and open your shell or IDE in the root directory of your project before running the npm start command.
The update of the NPM means the update node package manager to the latest version. The update of NPM updates the Node.js and modules to the latest version. Syntax: npm update [-g] [<pkg>...] Here, -g refers to global and pkg refers to package.
If no package name is specified, all packages in the specified location (global or local) will be updated. As of [email protected], the npm update will only inspect top-level packages. Prior versions of npm would also recursively inspect all dependencies. To get the old behavior, use npm --depth 9999 update.
Some strange issues can be resolved by simply running npm cache clean and trying again. If you are having trouble with npm install, use the -verbose option to see more details.
More... Manually run the command given in the text to upgrade one package at a time, e.g. npm i --save-dev [email protected] Every now and then after installing your projects dependencies, npm i, you will be met with an error from NPM that looks something like
brew uninstall --force node
sudo rm -rf /usr/local/lib/node_modules
brew install npm
Worked just fine
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