Getting error npm ERR! code EUNSUPPORTEDPROTOCOL while running npm install
Asked Answered
N

6

17

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 ?

Nostalgia answered 1/1, 2022 at 2:31 Comment(2)
happens to me as well, this looks relevant: github.com/prisma/prisma/issues/5340Gerick
Do you have a "[packageName]": "workspace:[version]" dependency for pnpm? If so you need to use pnpm instead (pnpm.io/workspaces)Anthodium
E
9

You can resolve this error instead of mentioning as workspace:* replace it with file:*. It helps me to resolve this issue.

Eiffel answered 5/4, 2023 at 7:26 Comment(0)
T
1

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.

Thermidor answered 20/8, 2022 at 17:57 Comment(0)
G
1

I got this because I accidentally tried running npm install -D postcss in a project being managed by pnpm. pnpm install -D postcss worked.

Gorse answered 24/2 at 1:13 Comment(0)
U
0

This successfully installed gulp:

yarn add gulp -i
Ulyssesumayyad answered 2/9, 2023 at 2:42 Comment(1)
Welcome to Stack Overflow! While this code may solve the question, including an explanation of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please edit your answer to add explanations and give an indication of what limitations and assumptions apply.Israelitish
G
0

I've been checking around and have also gotten a way around:

Go to your new terminal window and simply install pnpm globally. The command to install it may vary according to the operating system.

Check out their installation page: https://pnpm.io/installation

Grundy answered 20/4 at 1:36 Comment(1)
pnpm is not npmDuwalt
J
-3

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 ^

Jacksmelt answered 1/1, 2022 at 2:41 Comment(1)
It got resolved after changes "@slidev/cli": "workspace:*", to `"@slidev/cli": "file:*", Thanks for answer.Nostalgia

© 2022 - 2024 — McMap. All rights reserved.