Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
23 stars 12 forks source link

[Bug] Workspace Node.js dependencies fail to install with Yarn 3.6.1 #1808

Closed tschaffter closed 1 year ago

tschaffter commented 1 year ago

Is there an existing issue for this?

What projects are you seeing the problem on?

No response

Current behavior

The workspace dependencies install successfully with the current version of Yarn (v3.3.0).

$ yarn install --immutable
...
➤ YN0007: │ @openapitools/openapi-generator-cli@npm:2.5.2 must be built because it never has been before or the last one failed
➤ YN0007: │ nx@npm:15.3.3 [15c3d] must be built because it never has been before or the last one failed
➤ YN0007: │ sage-monorepo@workspace:. must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1m 17s
➤ YN0000: Done with warnings in 3m 7s

As part of #1806, the version of Yarn would be updated to v3.6.1. However, the dependencies no longer install successfully.

First, we need to configure the workspace to use Yarn 3.6.1:

vscode@f82a8bc3fa7f:~/sage-monorepo$ yarn set version 3.6.1
➤ YN0000: Retrieving https://repo.yarnpkg.com/3.6.1/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-3.6.1.cjs
➤ YN0000: Done in 0s 703ms

Installing the dependencies now fails:

$ yarn install --immutable
...
➤ YN0002: │ sage-monorepo@workspace:. doesn't provide yargs-parser (paf4b7), requested by @nxrocks/nx-spring-boot
➤ YN0002: │ sage-monorepo@workspace:. doesn't provide yocto-queue (p3bb48), requested by @nxrocks/nx-spring-boot
➤ 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 1s 107ms

➤ YN0000: ┌ Post-resolution validation
➤ YN0000: │ @@ -29505,33 +29505,30 @@
➤ YN0000: │    linkType: hard
➤ YN0000: │  
➤ YN0000: │  "typescript@patch:typescript@4.8.4#~builtin<compat/typescript>, typescript@patch:typescript@^4.6.2#~builtin<compat/typescript>":
➤ YN0000: │    version: 4.8.4
➤ YN0028: │ -  resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin<compat/typescript>::version=4.8.4&hash=0102e9"
➤ YN0028: │ +  resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin<compat/typescript>::version=4.8.4&hash=1a91c8"
➤ YN0000: │    bin:
➤ YN0000: │      tsc: bin/tsc
➤ YN0000: │      tsserver: bin/tsserver
➤ YN0028: │ -  checksum: 301459fc3eb3b1a38fe91bf96d98eb55da88a9cb17b4ef80b4d105d620f4d547ba776cc27b44cc2ef58b66eda23fe0a74142feb5e79a6fb99f54fc018a696afa
➤ YN0000: │    languageName: node
➤ YN0000: │    linkType: hard
➤ YN0000: │  
➤ YN0000: │  "typescript@patch:typescript@^5.0.2#~builtin<compat/typescript>, typescript@patch:typescript@~5.0.4#~builtin<compat/typescript>":
➤ YN0000: │    version: 5.0.4
➤ YN0028: │ -  resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin<compat/typescript>::version=5.0.4&hash=d73830"
➤ YN0028: │ +  resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin<compat/typescript>::version=5.0.4&hash=b5f058"
➤ YN0000: │    bin:
➤ YN0000: │      tsc: bin/tsc
➤ YN0000: │      tsserver: bin/tsserver
➤ YN0028: │ -  checksum: 6a1fe9a77bb9c5176ead919cc4a1499ee63e46b4e05bf667079f11bf3a8f7887f135aa72460a4c3b016e6e6bb65a822cb8689a6d86cbfe92d22cc9f501f09213
➤ YN0000: │    languageName: node
➤ YN0000: │    linkType: hard
➤ YN0000: │  
➤ YN0000: │  "typescript@patch:typescript@next#~builtin<compat/typescript>":
➤ YN0000: │    version: 5.1.0-dev.20230429
➤ YN0028: │ -  resolution: "typescript@patch:typescript@npm%3A5.1.0-dev.20230429#~builtin<compat/typescript>::version=5.1.0-dev.20230429&hash=d73830"
➤ YN0028: │ +  resolution: "typescript@patch:typescript@npm%3A5.1.0-dev.20230429#~builtin<compat/typescript>::version=5.1.0-dev.20230429&hash=77c9e2"
➤ YN0000: │    bin:
➤ YN0000: │      tsc: bin/tsc
➤ YN0000: │      tsserver: bin/tsserver
➤ YN0028: │ -  checksum: b9d49ee1dc244a366954b10028366420fc2e43395e56289efd0a1480775c911d7fcb6fc761db15cc9be4513890dd4c358c1782d800116a48c41983d2888715e8
➤ YN0000: │    languageName: node
➤ YN0000: │    linkType: hard
➤ YN0000: │  
➤ YN0000: │  "typescript@patch:typescript@~3.9.10#~builtin<compat/typescript>":
➤ YN0000: │ 
➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
➤ YN0000: └ Completed in 0s 276ms
➤ YN0000: Failed with errors in 1s 408ms

Expected behavior

The existing dependencies should install successfully with the latest version of Yarn (3.6.1).

Anything else?

No response

Commit ID

No response

Are you developing inside the dev container?

Code of Conduct

tschaffter commented 1 year ago

Solution

Removing the lock file yarn.lock solves the issue.

Then:

Note: The task prepare-python failed. The new version of Poetry installed in the new dev container may be the reason.