Nx: npx create-nx-workspace myworkspace --preset=empty fail to create workspace

Created on 28 Jul 2019  路  10Comments  路  Source: nrwl/nx

_Please make sure you have read the submission guidelines before posting an issue_

Prerequisites

Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.

  • [ x] I am running the latest version
  • [ x] I checked the documentation and found no answer
  • [ x] I checked to make sure that this issue has not already been filed
  • [ ] I'm reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)

Expected Behavior

npx create-nx-workspace myworkspace --preset=empty
Should create the empty Nx workspace

Current Behavior

Currently on running about mentioned command is throwing following error

Package install failed, see above.
(node:18176) UnhandledPromiseRejectionWarning: Error: Command failed: "C:\Users\AppData\Local\Temp\tmp-18176s8KFdRnueg4T\node_modules.bin\tao" new "myworkspace" "--preset=empty" --collection=@nrwl/workspace
ules.bin\tao" new "myworkspace" "--preset=empty" --collection=@nrwl/workspace
at checkExecSyncError (child_process.js:629:11)
(node:18176) UnhandledPromiseRejectionWarning: Error: Command failed: "C:\Users\AppData\Local\Temp\tmp-18176s8KFdRnueg4T\node_modules.bin\tao" new "myworkspace" "--preset=empty" --collection=@nrwl/workspace
at checkExecSyncError (child_process.js:629:11) at Object.execSync (child_process.js:666:13)
at createApp (C:\Users\AppData\Roaming\npm-cache_npx\18176\node_modules\create-nx-workspace\bin\create-nx-workspace.js:202:21) at C:\Users\M1012493\AppData\Roaming\npm-cache_npx\18176\node_modules\create-nx-workspace\bin\create-nx-workspace.js:51:9 at process._tickCallback (internal/process/next_tick.js:68:7)(node:18176) 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(). (rejection id: 1)(node:18176) [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

Here are the steps for reproducing the issue.

  1. execute npx create-nx-workspace myworkspace --preset=empty command
  2. Select Nx [Extensible CLI for JavaScript and TypeScript applications]
  3. At this point execution of command will hang with the prompt to select stylesheet format
  4. Press Enter , StyleSheet format selection menu will get activate
  5. Select scss and enter
  6. Above mentioned error will be reported.

Context

Please provide any relevant information about your setup:

  • Nx 8.4.0
  • Angular CLI 8.1.0
bug

Most helpful comment

I'am getting also a yarn command not found error while installing with npm

All 10 comments

i tried npx --ignore-existing create-nx-workspace@latest nxtest --preset empty as well. Still i'm getting same error.

On my end, I am not able to choose the SCSS extension, arrow keys do not work (while they worked for the previous steps).

Selecting CSS by default prompts me an error saying that yarn isn't a recognized package.

To resolve my issue I simply

 npx [email protected] myworkspace

@Maryannah thank you, this worked for me. This mean the @latest has some bug.

I would like to echo that there is definitely a bug in the latest builds that doesn't allow the arrow keys to function when selecting the styles extension. Selecting CSS which is the first option does seem to allow the process to move forward.

@Pekes317 indeed: the arrow keys don't function for selecting the style sheet extension on 8.4.0 or 8.4.1. Reverting to 8.3.0 solves the problem.

I'am getting also a yarn command not found error while installing with npm

IMO when you encounter an issue that has been stated by another user, you should instead react with an emote as to not pollute the topic with "+1"-ish answers.

I second that of @JohnnyDevNull about the yarn command not found error while installing with npm. Installing yarn fixes issue. If there was an options to choose package manager so the Nx would use npm or yarn depending user choice.

Thank you folks for filing the issue. I was able to reproduce the problem on windows, and fixed it here: 5074b82bb261113541192504d755f803c6d5a9af

For anyone still experiencing this issue (specifically with the yarn install --silent command) make sure you do not have that yarn binary from the cmdtest debian package installed. If you do remove it and optionally install the intended yarn package

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Svancara picture Svancara  路  3Comments

IonFoXx picture IonFoXx  路  3Comments

SWGeekPD picture SWGeekPD  路  3Comments

elliotmendiola picture elliotmendiola  路  3Comments

Koslun picture Koslun  路  3Comments