question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v12.10.0 brings in nrwl/cli@13.10 which causes install to fail

See original GitHub issue

Current Behavior

This is a multi-tiered problem.

When installing version 12.10 of NX, it has a nrwl/cli dependency of *. This means it brings in v13.10.0 of nrwl/cli. https://github.com/nrwl/nx/blob/12.10.x/packages/nx/package.json

v13.10 of nrwl/cli has a code dependency on tar-stream but it is not declared in package.json https://github.com/nrwl/nx/blob/13.10.0/packages/cli/package.json

nx v12.10.0 does not declare tar-stream in its package.json but nx v13.10.0 does. So for an nx v13 user this isn’t an issue but for a v12 user, it results in a “module not found” error.

Expected Behavior

  1. nrwl/cli in package.json should not be set to “*”. It should use the corresponding version. So nx@12 should use cli@12.
  2. cli@13 needs to declare tar-stream as a dependency in its package.sjon

Yes, this worked until 13.10 was released.

Steps to Reproduce

Install nx v12 in your repo and the npm install will fail with “tar-stream module not found”

Failure Logs

Error: Cannot find module ‘tar-stream’ 11:10:45 Require stack: 11:10:45 - /node_modules/nx/node_modules/@nrwl/tao/node_modules/nx/src/utils/fileutils.js 11:10:45 - /node_modules/nx/node_modules/@nrwl/tao/node_modules/nx/src/utils/cache-directory.js 11:10:45 - /node_modules/nx/node_modules/@nrwl/tao/node_modules/nx/src/project-graph/nx-deps-cache.js 11:10:45 - /node_modules/nx/node_modules/@nrwl/tao/node_modules/nx/src/project-graph/project-graph.js 11:10:45 - /node_modules/nx/node_modules/@nrwl/tao/node_modules/nx/bin/init.js 11:10:45 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)

Environment

Node : 14.17.5 OS : darwin x64 npm : 6.14.14

nx : 12.10.0 @nrwl/angular : 12.10.0 @nrwl/cli : 12.10.0 @nrwl/cypress : 12.10.0 @nrwl/devkit : 12.10.0 @nrwl/eslint-plugin-nx : 12.10.0 @nrwl/express : 12.10.0 @nrwl/jest : 12.10.0 @nrwl/linter : 12.10.0 @nrwl/nest : 12.10.0 @nrwl/next : Not Found @nrwl/node : 12.10.0 @nrwl/nx-cloud : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 12.10.0 @nrwl/web : Not Found @nrwl/workspace : 12.10.0 @nrwl/storybook : 12.10.0 @nrwl/gatsby : Not Found typescript : 4.2.4

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
willyboycommented, Apr 11, 2022

For anyone else experiencing this, workaround is to add an optional dependency in package.json. It seems to override the nested dep

"optionalDependencies": {
    "@nrwl/cli": "13.7.1",
3reactions
luke-rogerscommented, May 1, 2022

Seems like a possible workaround to the issues above is to split the creation of the workspace into 2 phases

  1. Create empty workspace - npx create-nx-workspace@12.10.1 <org name>
  2. Add the dependency on @nwrl/angular - npm i @nrwl/angular@12.10.1
  3. Add the optionalDependency on @nrwl/cli@12.10.1
  4. Create the angular project - nx g @nrwl/angular:app <app name>
  5. Run nx g convert-to-nx-project --all in the workspace to convert to using project.json rather than inlined configuration, nx console to failed to pick up and run commands without doing this

Hoping nothing would be missed versus using npx create-nx-workspace@12.10.1 <org name> --preset=angular directly if it worked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get help with Windows upgrade and installation errors
See some of the most common upgrade and installation errors for Windows 10 and Windows 11, and what you can do to try...
Read more >
nvm install node fails to install on macOS Big Sur M1 Chip
I'm trying to install the latest version of node using nvm. ... lts/dubnium -> v10.23.0 (-> N/A) lts/erbium -> v12.19.1 (-> N/A) lts/fermium ......
Read more >
npm WARN: npm does not support Node.js v12.4.0
go to your windows search bar and search for Node, right click to open file location, run the uninstaller to uninstall NodeJs. then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found