Getting error npm ERR! code EUNSUPPORTEDPROTOCOL while running npm install

Viewed 4661

While installing npm install am getting below error. Following are my node version.

OS : MacOS Big Sur V11.6.2

Macs-MacBook-Pro-3:slides mac$ node -v
v16.13.1
Macs-MacBook-Pro-3:slides mac$ npm -v
8.3.0
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mac/.npm/_logs/2022-01-01T02_28_04_430Z-debug-0.log

Any help here ?

2 Answers

You may try to use yarn command with -W flag instead of npm command which might be helpful.

I could resolve the same issue in this way.

Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command with yarn again with the -W flag (or --ignore-workspace-root-check). info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

You can write this command on your terminal/cmd:

sudo npm install -g npm-reinstall

and try npm i {package_name} again

npm i nodemon

for example ^

Related