2021-01-12 18:47

Creating new workspace using "npx create-nx-workspace@latest" fails, could not resolve dependency

Current Behavior

When creating a new workspace using npx create-nx-workspace, the workspace creation fails due to an unresolved dependency from codelyzer.0.1.

Expected Behavior

The workspace is created and does not fail.

Steps to Reproduce

In powershell/cmd, run npx create-nx-workspace - Workspace name (e.g., org name) test - What to create in the new workspace angular-nest [a workspace with a full stack application (Angular + Nest)] - Application name test - Default stylesheet format SASS(.scss) [ http://sass-lang.com ] - Default linter ESLint [ Modern linting tool ] - Use Nx Cloud? (It's free and doesn't require registration.) Yes [Faster builds, run details, Github in tegration. Learn more at https://nx.app]

Failure Logs

CREATE jest.config.js (131 bytes)
CREATE jest.preset.js (82 bytes)
CREATE apps/test/tsconfig.editor.json (119 bytes)
CREATE apps/test/tsconfig.json (249 bytes)
CREATE apps/test/src/favicon.ico (15086 bytes)
CREATE apps/test/.browserslistrc (853 bytes)
CREATE apps/test/tsconfig.app.json (163 bytes)
CREATE apps/test/src/index.html (320 bytes)
CREATE apps/test/src/main.ts (377 bytes)
CREATE apps/test/src/polyfills.ts (2833 bytes)
CREATE apps/test/src/styles.scss (80 bytes)
CREATE apps/test/src/assets/.gitkeep (0 bytes)
CREATE apps/test/src/environments/environment.prod.ts (52 bytes)
CREATE apps/test/src/environments/environment.ts (663 bytes)
CREATE apps/test/src/app/app.module.ts (373 bytes)
CREATE apps/test/src/app/app.component.html (223 bytes)
CREATE apps/test/src/app/app.component.spec.ts (602 bytes)
CREATE apps/test/src/app/app.component.ts (384 bytes)
CREATE apps/test/src/app/app.component.scss (2088 bytes)
CREATE .eslintrc.json (1101 bytes)
CREATE apps/test/.eslintrc.json (80 bytes)
CREATE apps/test/jest.config.js (737 bytes)
CREATE apps/test/tsconfig.spec.json (233 bytes)
CREATE apps/test/src/test-setup.ts (30 bytes)
CREATE apps/test-e2e/.eslintrc.json (282 bytes)
CREATE apps/test-e2e/cypress.json (408 bytes)
CREATE apps/test-e2e/tsconfig.e2e.json (222 bytes)
CREATE apps/test-e2e/tsconfig.json (147 bytes)
CREATE apps/test-e2e/src/fixtures/example.json (80 bytes)
CREATE apps/test-e2e/src/integration/app.spec.ts (400 bytes)
CREATE apps/test-e2e/src/plugins/index.js (832 bytes)
CREATE apps/test-e2e/src/support/app.po.ts (47 bytes)
CREATE apps/test-e2e/src/support/commands.ts (1133 bytes)
CREATE apps/test-e2e/src/support/index.ts (599 bytes)
CREATE apps/api/.eslintrc.json (80 bytes)
CREATE apps/api/tsconfig.app.json (237 bytes)
CREATE apps/api/tsconfig.json (197 bytes)
CREATE apps/api/src/main.ts (553 bytes)
CREATE apps/api/src/app/.gitkeep (0 bytes)
CREATE apps/api/src/assets/.gitkeep (0 bytes)
CREATE apps/api/src/environments/environment.prod.ts (52 bytes)
CREATE apps/api/src/environments/environment.ts (53 bytes)
CREATE apps/api/jest.config.js (313 bytes)
CREATE apps/api/tsconfig.spec.json (199 bytes)
CREATE apps/test/proxy.conf.json (79 bytes)
CREATE apps/api/src/app/app.controller.spec.ts (617 bytes)
CREATE apps/api/src/app/app.controller.ts (330 bytes)
CREATE apps/api/src/app/app.module.ts (250 bytes)
CREATE apps/api/src/app/app.service.spec.ts (495 bytes)
CREATE apps/api/src/app/app.service.ts (206 bytes)
CREATE libs/api-interfaces/.eslintrc.json (80 bytes)
CREATE libs/api-interfaces/README.md (182 bytes)
CREATE libs/api-interfaces/tsconfig.json (197 bytes)
CREATE libs/api-interfaces/tsconfig.lib.json (172 bytes)
CREATE libs/api-interfaces/src/index.ts (38 bytes)
CREATE libs/api-interfaces/src/lib/api-interfaces.ts (48 bytes)
CREATE libs/api-interfaces/jest.config.js (343 bytes)
CREATE libs/api-interfaces/tsconfig.spec.json (273 bytes)
UPDATE angular.json (6056 bytes)
UPDATE package.json (2567 bytes)
UPDATE .vscode/extensions.json (200 bytes)
UPDATE nx.json (745 bytes)
UPDATE tsconfig.base.json (581 bytes)
| Installing packages...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: test.0.0
npm ERR! Found: /compiler.2.3
npm ERR! node_modules//compiler
npm ERR!   /compiler@"^10.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer /compiler@">=2.3.1 <9.0.0 || >8.0.0-beta <9.0.0" from codelyzer.0.1
npm ERR! node_modules/codelyzer
npm ERR!   dev codelyzer@"~5.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Andrew\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Andrew\AppData\Local\npm-cache\_logs\2020-11-13T20_58_01_213Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
npm ERR! code 1
npm ERR! path C:\Users\Andrew\Developer\test
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "ng "g" "\workspace:preset" "--name=test" "--style=scss" "--npmScope=test" "--preset=angular-nest" "--cli=ng" "--interactive=false""

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Andrew\AppData\Local\npm-cache\_logs\2020-11-13T20_58_01_293Z-debug.log
Workspace creation failed, see above.
npm ERR! code 1
npm ERR! path C:\Users\Andrew\AppData\Local\Temp\tmp-10160gl7vwF6QFFjd
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "tao "new" "test" "--preset=angular-nest" "--appName=test" "--style=scss" "--linter=eslint" "--nxCloud" "--interactive=false" "--collection=C:\Users\Andrew\AppData\Local\Temp\tmp-10160gl7vwF6QFFjd\node_modules\\workspace\collection.json" "--cli=ng" "--nxWorkspaceRoot=C:\Users\Andrew\Developer""

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Andrew\AppData\Local\npm-cache\_logs\2020-11-13T20_58_01_360Z-debug.log
    err = new Error(msg);

Error: Command failed: npx tao new test  --preset="angular-nest" --appName="test" --style="scss" --linter="eslint" --nxCloud --interactive=false --collection=C:\Users\Andrew\AppData\Local\Temp\tmp-10160gl7vwF6QFFjd\node_modules\\workspace\collection.json --cli=ng --nxWorkspaceRoot="C:\Users\Andrew\Developer"
    at checkExecSyncError (node:child_process:636:11)
    at Object.execSync (node:child_process:672:15)
    at createApp (C:\Users\Andrew\AppData\Local\npm-cache\_npx\505743838affa773\node_modules\create-nx-workspace\bin\create-nx-workspace.js:424:21)
    at C:\Users\Andrew\AppData\Local\npm-cache\_npx\505743838affa773\node_modules\create-nx-workspace\bin\create-nx-workspace.js:92:29
    at processTicksAndRejections (node:internal/process/task_queues:93:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 11072,
  stdout: null,
  stderr: null
npm ERR! code 1
npm ERR! path C:\Users\Andrew\Developer
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c ""create-nx-workspace""

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Andrew\AppData\Local\npm-cache\_logs\2020-11-13T20_58_01_403Z-debug.log


Windows 10 - Version 2004 (OS Build 19041.572) PowerShell 7.0.3 Node v15.2.0 npm 7.0.11


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39524834 weixin_39524834 4月前

    npm i -g npm solved the issues, I just haved got crazy with the package manager npm and yarn for few days ago. Do not try with NPM and YARN (Yarn 2)

    点赞 评论 复制链接分享
  • weixin_39524834 weixin_39524834 4月前

    I successful migrate and create new workspace with npm instead of yarn 2 or npm

    点赞 评论 复制链接分享
  • weixin_39785524 weixin_39785524 4月前

    Hi there ! Should we close this issue now?

    点赞 评论 复制链接分享
  • weixin_39524834 weixin_39524834 4月前

    yeah, feel free to close this, it easy sir
    , if you have trouble just open your issues again

    点赞 评论 复制链接分享