Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm ERR! code EUNSUPPORTEDPROTOCOL (v0.82.0) #2319

Closed
blaxk opened this issue May 2, 2023 · 12 comments · Fixed by #2325 · 4 remaining pull requests
Closed

npm ERR! code EUNSUPPORTEDPROTOCOL (v0.82.0) #2319

blaxk opened this issue May 2, 2023 · 12 comments · Fixed by #2325 · 4 remaining pull requests
Assignees

Comments

@blaxk
Copy link

blaxk commented May 2, 2023

I was using the v0.80.0 version without problems.
But while trying to install version v0.82.0 I got an error.

npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*

package.json

{
   ...
   "dependencies": {
      ...
      "@nivo/bar": "0.80.0",
      "@nivo/core": "0.80.0",
      "@nivo/line": "0.80.0",
      "@nivo/pie": "0.80.0",
      "next": "13.3.4",
      "react": "18.2.0",
      "react-dom": "18.2.0",
   },
   "devDependencies": {
      "eslint-config-next": "13.3.4"
   }
}
  • OS: macOS Ventura 13.3.1
  • Node: v16.19.1
  • Npm: v9.6.5
@plouc
Copy link
Owner

plouc commented May 2, 2023

I switched to pnpm and the workspace protocol is the recommendation for monorepos, although [it should be replaced eventually according to the doc, it might be due to lerna.

That's a pretty big issue, I'll try to release a new version without this issue asap, for now please stick with your current version.

@plouc
Copy link
Owner

plouc commented May 2, 2023

So it does update the main dependencies with proper versions:

"dependencies": {
    "@nivo/scales": "0.82.0",
    "@react-spring/web": "9.4.5 || ^9.7.2",
    "@types/d3-format": "^1.4.1",
    "@types/d3-time-format": "^2.3.1",
    "@types/prop-types": "^15.7.2",
    "d3-format": "^1.4.4",
    "d3-time-format": "^3.0.0",
    "prop-types": "^15.7.2"
},

But the peer dependencies still use the workspace protocol:

"peerDependencies": {
    "@nivo/core": "workspace:*",
    "react": ">= 16.14.0 < 19.0.0"
},

I need to see if lerna mentions anything about this.

@plouc
Copy link
Owner

plouc commented May 2, 2023

Opened an issue on lerna.

@wheresvic
Copy link

I was able to get around this with the --legacy-peer-deps flag.

@plouc
Copy link
Owner

plouc commented May 2, 2023

Thank you for sharing this @wheresvic.

@ghiscoding
Copy link

ghiscoding commented May 2, 2023

@plouc hello, I'm the maintainer of Lerna-Lite I prefer to write you directly here since it's probably better not to promote Lerna forks in Lerna directly, so anyway... Lerna-Lite does support bumping peer deps but under a flag (version#--allow-peer-dependencies-update) since by default peer deps should in theory never be updated unless explicitly wanting to (hence the flag). Also note that I pushed a fix in Lerna-Lite for an issue reported with workspace:^ in peer deps, I'll release a new version tonight, so it might be better to wait tomorrow if you ever want to give it a try

I also replied to your Lerna issue by mentioning why Lerna does not yet support this feature.

Just wanted to provide more info and possible alternative... cheers

@Christopher-Stolfa
Copy link

I managed to install this package by selecting the previous version npm i @nivo/core@^0.81.0.

@plouc
Copy link
Owner

plouc commented May 2, 2023

@ghiscoding, thank you for reaching out, and for the reply on the lerna issue I opened! I might give it a try.

@plouc
Copy link
Owner

plouc commented May 2, 2023

Actually, maybe for now I'll move @nivo/core to a regular dependency, the only benefit is to prevent potential duplication, but on the other hand, all other core dependencies (@nivo/tooltip, @nivo/scales, @nivo/axes...) are currently expressed as regular ones.

The current approach also comes with some limitations, it means that you need to have all versions strictly aligned, which might be an issue for users who cannot/don't want to upgrade all charts at once.

With this new approach, they could, at the expense of a bigger bundle size though.

@nivo/core is not like other peer dependencies such as React or babel, where only one version should exist, it's OK to have several versions (but will affect the resulting bundle size).

@chelouche9
Copy link

Happened to me as well. We only have one component using nivo so we just downgraded the version and it works

npm i @nivo/core@0.80.0 @nivo/pie@0.80.0

@mirogajdos
Copy link

Same issue after bumping version from 0.81.0 to 0.82.1

$ node -v
v18.16.0
$ npm -v
9.5.1
$ npm ci --cache .npm --prefer-offline
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:*
npm ERR! A complete log of this run can be found in:

@plouc
Copy link
Owner

plouc commented May 7, 2023

Moved @nivo/core as a regular dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment