v12.10.0 brings in nrwl/cli@13.10 which causes install to fail
See original GitHub issueCurrent 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
- nrwl/cli in package.json should not be set to “*”. It should use the corresponding version. So nx@12 should use cli@12.
- 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:
- Created a year ago
- Reactions:5
- Comments:8 (5 by maintainers)
For anyone else experiencing this, workaround is to add an optional dependency in package.json. It seems to override the nested dep
Seems like a possible workaround to the issues above is to split the creation of the workspace into 2 phases
npx create-nx-workspace@12.10.1 <org name>
npm i @nrwl/angular@12.10.1
optionalDependency
on@nrwl/cli@12.10.1
nx g @nrwl/angular:app <app name>
nx g convert-to-nx-project --all
in the workspace to convert to usingproject.json
rather than inlined configuration, nx console to failed to pick up and run commands without doing thisHoping nothing would be missed versus using
npx create-nx-workspace@12.10.1 <org name> --preset=angular
directly if it worked.