weixin_39879651
weixin_39879651
2021-01-12 18:48

npx create-nx-workspace@latest raises an exception

Current Behavior

Basic npx create-nx-workspace command raises an exception

Expected Behavior

First time user, so no idea

Steps to Reproduce

Nothing special, on a windows 10 pc, do: npx create-nx-workspace see the configuration I selected below.

not really, it's before that.

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

C:\Lander\WS>npx create-nx-workspace npx: installed 194 in 9.194s ? Workspace name (e.g., org name) gymcomp ? What to create in the new workspace angular [a workspace with a single Angular application] ? Application name artcomp ? Default stylesheet format SASS(.scss) [ http://sass-lang.com ] ? Use the free tier of the distributed cache provided by Nx Cloud? Yes [Faster command execution, faster CI. Learn more at https://nx. app] Creating a sandbox with Nx... warning /cli > universal-analytics > request.88.2: request has been deprecated, see https://github.com/request/request/issue s/3142 new gymcomp --preset="angular" --appName="artcomp" --style="scss" --nxCloud --interactive=false --collection=/workspace CREATE gymcomp/nx.json (514 bytes) CREATE gymcomp/tsconfig.base.json (509 bytes) CREATE gymcomp/package.json (1273 bytes) CREATE gymcomp/README.md (3400 bytes) CREATE gymcomp/.editorconfig (245 bytes) CREATE gymcomp/.gitignore (503 bytes) CREATE gymcomp/.prettierignore (74 bytes) CREATE gymcomp/.prettierrc (26 bytes) CREATE gymcomp/angular.json (96 bytes) CREATE gymcomp/decorate-angular-cli.js (3136 bytes) CREATE gymcomp/tools/tsconfig.tools.json (223 bytes) CREATE gymcomp/tools/schematics/.gitkeep (0 bytes) CREATE gymcomp/apps/.gitkeep (0 bytes) CREATE gymcomp/libs/.gitkeep (0 bytes) √ Packages installed successfully. √ Packages installed successfully. ? Would you like to share anonymous usage data about this project with the Angular Team at ? Would you like to share anonymous usage data about this project with the Angular Team at Google under Google’s Privacy Policy at https://policies.google.com/privacy? For more details and how to change this setting, see http://angular.io/analytics. Yes

Thank you for sharing anonymous usage data. Would you change your mind, the following command will disable this feature entirely:

ng analytics project off

CREATE jest.config.js (252 bytes) CREATE tslint.json (2311 bytes) CREATE apps/artcomp/tsconfig.json (197 bytes) CREATE apps/artcomp/src/favicon.ico (15086 bytes) CREATE apps/artcomp/.browserslistrc (853 bytes) CREATE apps/artcomp/tsconfig.app.json (163 bytes) CREATE apps/artcomp/tslint.json (246 bytes) CREATE apps/artcomp/src/index.html (329 bytes) CREATE apps/artcomp/src/main.ts (377 bytes) CREATE apps/artcomp/src/polyfills.ts (2833 bytes) CREATE apps/artcomp/src/styles.scss (80 bytes) CREATE apps/artcomp/src/assets/.gitkeep (0 bytes) CREATE apps/artcomp/src/environments/environment.prod.ts (52 bytes) CREATE apps/artcomp/src/environments/environment.ts (663 bytes) CREATE apps/artcomp/src/app/app.module.ts (298 bytes) CREATE apps/artcomp/src/app/app.component.html (2984 bytes) CREATE apps/artcomp/src/app/app.component.spec.ts (926 bytes) CREATE apps/artcomp/src/app/app.component.ts (217 bytes) CREATE apps/artcomp/src/app/app.component.scss (2088 bytes) CREATE apps/artcomp/jest.config.js (703 bytes) CREATE apps/artcomp/tsconfig.spec.json (233 bytes) CREATE apps/artcomp/src/test-setup.ts (30 bytes) CREATE apps/artcomp-e2e/tslint.json (97 bytes) CREATE apps/artcomp-e2e/cypress.json (414 bytes) CREATE apps/artcomp-e2e/tsconfig.e2e.json (222 bytes) CREATE apps/artcomp-e2e/tsconfig.json (147 bytes) CREATE apps/artcomp-e2e/src/fixtures/example.json (80 bytes) CREATE apps/artcomp-e2e/src/integration/app.spec.ts (406 bytes) CREATE apps/artcomp-e2e/src/plugins/index.js (832 bytes) CREATE apps/artcomp-e2e/src/support/app.po.ts (47 bytes) CREATE apps/artcomp-e2e/src/support/commands.ts (1068 bytes) CREATE apps/artcomp-e2e/src/support/index.ts (599 bytes) UPDATE angular.json (4283 bytes) UPDATE package.json (2068 bytes) UPDATE nx.json (645 bytes) √ Packages installed successfully. √ Packages installed successfully. warning: LF will be replaced by CRLF in .editorconfig. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in .gitignore. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in .prettierignore. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in .prettierrc. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in README.md. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in angular.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/cypress.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/src/fixtures/example.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/src/integration/app.spec.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/src/plugins/index.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/src/support/app.po.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/src/support/commands.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/src/support/index.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/tsconfig.e2e.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/tsconfig.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp-e2e/tslint.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/.browserslistrc. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/jest.config.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/app/app.component.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/app/app.component.scss. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/app/app.component.spec.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/app/app.component.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/app/app.module.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/environments/environment.prod.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/environments/environment.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/main.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/polyfills.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/styles.scss. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/src/test-setup.ts. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/tsconfig.app.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/tsconfig.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/tsconfig.spec.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in apps/artcomp/tslint.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in decorate-angular-cli.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in jest.config.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in nx.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in package-lock.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in package.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in tools/tsconfig.tools.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in tsconfig.base.json. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in tslint.json. The file will have its original line endings in your working directory Successfully initialized git.

———————————————————————————————————————————————

'.' is not recognized as an internal or external command, operable program or batch file. (node:13680) UnhandledPromiseRejectionWarning: Error: Command failed: ./node_modules/.bin/nx g /nx-cloud:init --no-analytics at checkExecSyncError (child_process.js:630:11) at Object.execSync (child_process.js:666:15) at createApp (C:\Users\Lander\AppData\Roaming\npm-cache_npx\13680\node_modules\create-nx-workspace\bin\create-nx-workspace.js:371 :25) at C:\Users\Lander\AppData\Roaming\npm-cache_npx\13680\node_modules\create-nx-workspace\bin\create-nx-workspace.js:85:25 at processTicksAndRejections (internal/process/task_queues.js:97:5) (node:13680) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an asyn c function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unha ndled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejection s_mode). (rejection id: 1) (node:13680) [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.

Environment

C:\Lander\WS>nx report 'nx' is not recognized as an internal or external command, operable program or batch file.

该提问来源于开源项目:nrwl/nx

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

3条回答

  • weixin_39785524 weixin_39785524 4月前

    Hi there ! Thank you for filing this issue! At the moment, unfortunately, I am not on a Windows machine, but later today I will be, so that I can try to reproduce your issue in the environment you are using.

    In the meantime, let us see if a proposed solution will solve your issue:

    It seems to me that two things may be causing your issue: 1. You might not have installed nx globally, since it is not recognised as a command. Please take a look in this page of the documentation. Please note that in order to be able to invoke the nx command directly, you will have to have the /cli installed globally. (Install /cli globally to invoke the command directly using nx, or use npm run nx or yarn nx.). Let me know if it works for you when you run npm run nx. 2. In order to actually produce a report, you need to be in an Nx Workspace, or else you will get this warning:

    
     NX  The current directory isn't part of an Nx workspace.
    

    From the information that you provided, it seems to me that you are trying to run nx report outsite your newly generated workspace gymcomp (you invoke the command from the C:\Lander\WS directory. Try moving into the gymcomp directory, and then run the command from there, usingn npm run nx:

    
    C:\Lander\WS\gymcomp> npm run nx report
    

    Please let me know if these steps help you, or if you need any more guidance! :)

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

    Thanks for reporting the issue!

    This was fixed with https://github.com/nrwl/nx/commit/f51d0d257c34a1f783b66529721884f45d5d5ead.

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

    perfect, tested & works

    点赞 评论 复制链接分享

相关推荐