25

I upgraded our project to yarn berry recently. Still using node_modules with nodeLinker: node-modules.

When running 'yarn' command i see below errors:

➤ YN0000: ┌ Link step
➤ YN0007: │ core-js@npm:2.6.12 must be built because it never has been before or the last one failed
➤ YN0007: │ @getgauge/cli@npm:1.4.3 must be built because it never has been before or the last one failed
➤ YN0007: │ protobufjs@npm:6.11.3 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:3.18.3 must be built because it never has been before or the last one failed
➤ YN0007: │ husky@npm:3.1.0 must be built because it never has been before or the last one failed
➤ YN0007: │ node-sass@npm:7.0.1 must be built because it never has been before or the last one failed
➤ YN0007: │ taiko@npm:1.2.7 must be built because it never has been before or the last one failed
➤ YN0007: │ taiko@npm:1.3.1 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.18.3 must be built because it never has been before or the last one failed

I am not sure why yarn is asking to build these packages. Earlier we never used to build a package inside node_modules. How can i fix this?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
akhil
  • 277
  • 3
  • 8

2 Answers2

0

In my project, when running into this error, prior to the Link step as quoted in the question above, where I was also getting a number of must be built because it never has been before or the last one failed errors, there were a number of warnings in the Resolution step, like:

➤ YN0000: ┌ Resolution step
➤ YN0002: │ vendor-frontend@workspace:. doesn't provide @babel/core (pa3ad5), requested by @babel/plugin-proposal-class-properties
➤ YN0002: │ vendor-frontend@workspace:. doesn't provide @babel/core (p4b1ed), requested by @babel/plugin-proposal-decorators
➤ YN0002: │ (... about a dozen more ...)
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 239ms

As Yarn suggests in that last message, I ran:

yarn explain peer-requirements pxxxxx

where in my case pxxxxx was actually pa3ad5, the code from the first of those "doesn't provide" warnings.

For me, this produced:

➤ YN0000: vendor-frontend@workspace:. doesn't provide @babel/core, breaking the following requirements:
➤ YN0000: @babel/helper-create-class-features-plugin@npm:7.20.7 [967d5] → ^7.0.0   ✘
➤ YN0000: @babel/plugin-proposal-class-properties@npm:7.18.6 [8c8ef]    → ^7.0.0-0 ✘
➤ YN0000: Note: these requirements start with @babel/plugin-proposal-class-properties@npm:7.18.6 [8c8ef]

"npm", eh? This prompted me to run:

npm install

This completed successfully:

added 23 packages, removed 32 packages, changed 18 packages, and audited 1351 packages in 15s

But my app (running in my local dev environment) was still showing a compile error.

So I tried circling back to the original command, once again running:

yarn install

This completed successfully, and got my local app up and running again.

Jon Schneider
  • 25,758
  • 23
  • 142
  • 170
-2

You can simply remove your yarn.lock file and try again.

YARN0007: This informational message occurs when Yarn wishes to let you know that a package will need to be built for the installation to complete. This usually occurs in only two cases: either the package never has been built before, or its previous build failed (returned a non-zero exit code).

If you remove your lock file, it will retry dependency resolution step.

Ayberk
  • 536
  • 2
  • 12