Yarn: "Manifest not found" error when switching symlinks from "link:" to "file:" in package.json

3.1k Views Asked by At

I'm in the process of upgrading some infrastructure to Node 16 from 12. As part of this, npm was also upgraded.

Prior to the upgrade, I had a symbolic link in my package.json represented as link:./dist/src/shared

{
  "name": "api",
  "private": true,
  "version": "1.0.0",
  "description": "API",
  "main": "server.js",
  "dependencies": {
    "shared": "link:./dist/src/shared",
  },
  "installConfig": {
    "hoistingLimits": "workspaces"
  }
}

I had an npm error npm ERR! Unsupported URL Type "link:": link:./dist/src/shared, which I found is because "link:" is no longer supported by npm. As I understand it, I have to switch from "link:" to "file:".

However, after switching from "link:" to "file:" in my package.json, I get the following error when running yarn install:

➤ YN0000: ┌ Resolution step
➤ YN0013: │ shared@file:./dist/src/shared#./dist/src/shared::hash=ce19ac&locator=api%40wor
➤ YN0001: │ Error: shared@file:./dist/src/shared#./dist/src/shared::hash=ce19ac&locator=api%40workspace%3Aapi: Manifest not found

From what I've found online, yarn should support both the "link:" and "file:" syntax. Anyone have any idea why it stops working when I switch to "file:"?

1

There are 1 best solutions below

0
On

I solved the same issue by adding a package.json file with the content {} in the target folder