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

Old cliui v7 dependency causing issues with yarn #19249

Closed
1 of 4 tasks
hakimio opened this issue Sep 20, 2023 · 2 comments · Fixed by #19374
Closed
1 of 4 tasks

Old cliui v7 dependency causing issues with yarn #19249

hakimio opened this issue Sep 20, 2023 · 2 comments · Fixed by #19374

Comments

@hakimio
Copy link

hakimio commented Sep 20, 2023

Current Behavior

Using yarn classic, when installing nx, I get the following message:

warning Pattern ["wrap-ansi@^7.0.0","wrap-ansi@^7.0.0","wrap-ansi@^7.0.0"] is trying to unpack in the same destination "C:\\Users\\<USERNAME>\\AppData\\Local\\Yarn\\Cache\\v6\\npm-wrap-ansi-cjs-8.1.0-56dc22368ee570face1b49819975d9b9a5e
ad214-integrity\\node_modules\\wrap-ansi-cjs" as pattern ["wrap-ansi-cjs@npm:wrap-ansi","wrap-ansi-cjs@npm:wrap-ansi@^7.0.0"]. This could result in non-deterministic behavior, skipping.

Then my Angular app fails to start with:

Unknown error: Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\<PROJECT_PATH>\node_modules\wrap-ansi\index.js from C:\Users\<PROJECT_PATH>\node_modules\yargs\node_modules\cliui\build\index.cjs not supported.
Instead change the require of index.js in C:\Users\<PROJECT_PATH>\node_modules\yargs\node_modules\cliui\build\index.cjs to a dynamic import() which is available in all CommonJS modules.

Expected Behavior

No errors during installation and no errors during app start.

GitHub Repo

No response

Steps to Reproduce

  1. Use yarn classic to install Angular app with nx workspace
  2. Try to start the app

Nx Report

   Node   : 18.17.1
   OS     : win32-x64
   yarn   : 1.22.19
   
   nx                 : 16.5.1
   @nx/js             : 16.5.1
   @nx/jest           : 16.5.1
   @nx/linter         : 16.5.1
   @nx/workspace      : 16.5.1
   @nx/angular        : 16.5.1
   @nx/cypress        : 16.5.1
   @nx/devkit         : 16.5.1
   @nx/esbuild        : 16.5.1
   @nx/eslint-plugin  : 16.5.1
   @nrwl/tao          : 16.5.1
   @nx/webpack        : 16.5.1
   typescript         : 5.1.6

Failure Logs

No response

Package Manager Version

1.22.19

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Pinning cliui version to v8 fixes the issue.

  "resolutions": {
    "cliui": "^8.0.1"
  }

The workaround was first discovered in this issue.

Related issue:
#17229

Is there any good reason why you haven't updated cliui yet?
nx package.json

@hakimio
Copy link
Author

hakimio commented Sep 20, 2023

Related: isaacs/jackspeak#5

Copy link

github-actions bot commented Nov 3, 2023

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant