philippe_b
philippe_b

Reputation: 41308

Unsupported URL Type "link:" while using NPM

Following some guidance on the net, I edited my package.json to include a link URL:

...
"dependencies": {
  ...
  "react": "link:../some-other-module/node_modules/react",
}

But when installing, I get the following error:

$ npm install
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "link:": link:../some-other-module/node_modules/react

Upvotes: 24

Views: 24515

Answers (2)

Arutsudar Arut
Arutsudar Arut

Reputation: 513

One other reason that we can get a similar error is,

  • when a project expects yarn and we use npm instead.
  • or when project expects pnpm we use npm instead

Use the appropriate package manager used in the project.

Source:

Upvotes: 18

philippe_b
philippe_b

Reputation: 41308

This is because link has been replaced with file in recent versions of NPM. Simply update your package.json:

...
"dependencies": {
  ...
  "react": "file:../some-other-module/node_modules/react",
}

Upvotes: 38

Related Questions