Nx: npx create-nx-workspace@latest fails on project scaffolding

Created on 23 Sep 2020  Â·  4Comments  Â·  Source: nrwl/nx

Current Behavior

$ npx create-nx-workspace@latest troyweb
npx: installed 179 in 15.407s
? What to create in the new workspace angular-nest      [a workspace with a full stack application (Angular + Nest)]
? Application name                    project-jump-start
? Default stylesheet format           SASS(.scss)  [ http://sass-lang.com   ]
? Use Nx Cloud? (It's free and doesn't require registration.) No
Creating a sandbox with Nx...
error @angular-devkit/[email protected]: The engine "yarn" is incompatible with this module. Expected version ">= 1.13.0".
error Found incompatible module
(node:31432) UnhandledPromiseRejectionWarning: Error: Command failed: yarn install --silent
    at checkExecSyncError (child_process.js:630:11)
    at Object.execSync (child_process.js:666:15)
    at createSandbox (C:\Users\Tyler\AppData\Roaming\npm-cache\_npx\31432\node_modules\create-nx-workspace\bin\create-nx-workspace.js:341:21)
    at C:\Users\Tyler\AppData\Roaming\npm-cache\_npx\31432\node_modules\create-nx-workspace\bin\create-nx-workspace.js:90:40
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:31432) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:31432) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
$ npm init nx-workspace troyweb
npx: installed 179 in 14.208s
? What to create in the new workspace angular-nest      [a workspace with a full stack application (Angular + Nest)]
? Application name                    project-jump-start
? Default stylesheet format           SASS(.scss)  [ http://sass-lang.com   ]
? Use Nx Cloud? (It's free and doesn't require registration.) Yes [Faster builds, run details, Github integration. Learn more at https://nx.app]
Creating a sandbox with Nx...
error @angular-devkit/[email protected]: The engine "yarn" is incompatible with this module. Expected version ">= 1.13.0".
error Found incompatible module
(node:41924) UnhandledPromiseRejectionWarning: Error: Command failed: yarn install --silent
    at checkExecSyncError (child_process.js:630:11)
    at Object.execSync (child_process.js:666:15)
    at createSandbox (C:\Users\Tyler\AppData\Roaming\npm-cache\_npx\3908\node_modules\create-nx-workspace\bin\create-nx-workspace.js:341:21)
    at C:\Users\Tyler\AppData\Roaming\npm-cache\_npx\3908\node_modules\create-nx-workspace\bin\create-nx-workspace.js:90:40
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:41924) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:41924) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
$ create-nx-workspace
? Workspace name (e.g., org name)     troyweb
? What to create in the new workspace angular-nest      [a workspace with a full stack application (Angular + Nest)]
? Application name                    project-jump-start
? Default stylesheet format           SASS(.scss)  [ http://sass-lang.com   ]
? Use Nx Cloud? (It's free and doesn't require registration.) Yes [Faster builds, run details, Github integration. Learn more at https://nx.app]
Creating a sandbox with Nx...
error @angular-devkit/[email protected]: The engine "yarn" is incompatible with this module. Expected version ">= 1.13.0".
error Found incompatible module
(node:39904) UnhandledPromiseRejectionWarning: Error: Command failed: yarn install --silent
    at checkExecSyncError (child_process.js:630:11)
    at Object.execSync (child_process.js:666:15)
    at createSandbox (C:\Users\Tyler\AppData\Roaming\npm\node_modules\create-nx-workspace\bin\create-nx-workspace.js:341:21)
    at C:\Users\Tyler\AppData\Roaming\npm\node_modules\create-nx-workspace\bin\create-nx-workspace.js:90:40
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:39904) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:39904) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Steps to Reproduce

npx create-nx-workspace@latest
npm init nx-workspace troyweb
create-nx-workspace

Environment

Windows 10 Pro x64
npm
bash

core bug

All 4 comments

Windows users, install this with powershell to avoid issues.

In my case, my yarn env was set to an incompatible version used in other projects thanks @Cammisuli

Thanks for submitting the issue! Do you think there is anything for us to do here? We don't control "architect", so I'm not sure if we can fix it.

@Tyler-V the error was clear with the yarn version in the log:

error @angular-devkit/[email protected]: The engine "yarn" is incompatible with this module. Expected version ">= 1.13.0".
error Found incompatible module

However, I got a simliar issue, but without a clear error message:

✖ Package install failed, see above.
The Schematic workflow failed. See above.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Workspace creation failed, see above.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(node:15832) UnhandledPromiseRejectionWarning: Error: Command failed: yarn tao new myorg  --preset="angular" --appName="dev" --style="scss" --linter="eslint" --interactive=false --collection=/private/var/folders/yt/c8f51mvj6kb6202gypdyx32h0000gn/T/tmp-15832UvbLEIGp1p81/node_modules/@nrwl/workspace/collection.json --cli=ng --nxWorkspaceRoot=/Users/x/code
    at checkExecSyncError (child_process.js:630:11)
    at Object.execSync (child_process.js:666:15)
    at createApp (/Users/x/.npm/_npx/15832/lib/node_modules/create-nx-workspace/bin/create-nx-workspace.js:424:21)
    at /Users/x/.npm/_npx/15832/lib/node_modules/create-nx-workspace/bin/create-nx-workspace.js:92:29
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:15832) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15832) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I can find out the error was actually from installing cypress due to https://github.com/cypress-io/cypress/issues/1401 when running npm install manually in the scaffolded project.

@vsavkin In this case, can we actually log the cypress installation error instead?

Indeed it seems that this was a problem with Yarn incompatibility. Since v10.4 the we default to NPM, unless --package-manager flag is used when creating a new workspace. I suppose this will solve your issue, but feel free to reopen in case there is a problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Koslun picture Koslun  Â·  3Comments

Svancara picture Svancara  Â·  3Comments

ZempTime picture ZempTime  Â·  3Comments

jasedwards picture jasedwards  Â·  3Comments

MichaelWarneke picture MichaelWarneke  Â·  3Comments