Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-nx-workspace stuck in "Creating your workspace" step #20270

Closed
1 of 4 tasks
Markus-Ende opened this issue Nov 16, 2023 · 29 comments · Fixed by #29122
Closed
1 of 4 tasks

create-nx-workspace stuck in "Creating your workspace" step #20270

Markus-Ende opened this issue Nov 16, 2023 · 29 comments · Fixed by #29122
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@Markus-Ende
Copy link

Current Behavior

❯ npx create-nx-workspace@latest testwslatest
Need to install the following packages:
  create-nx-workspace@17.1.2
Ok to proceed? (y)

 >  NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Which stack do you want to use? · angular
✔ Integrated monorepo, or standalone project? · integrated
✔ Application name · testwslatest
✔ Which bundler would you like to use? · webpack
✔ Default stylesheet format · css
✔ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? · Yes
✔ Test runner to use for end to end (E2E) tests · cypress
✔ Enable distributed caching to make your CI faster · No

 >  NX   Creating your v17.1.2 workspace.

   To make sure the command works reliably in all environments, and that the preset is applied correctly,
   Nx will run "npm install" several times. Please wait.

✔ Installing dependencies with npm
⠸ Creating your workspace in testwslatest

Stuck in this state, no progress.

Is there some way to get more logs?

Expected Behavior

Should finish creating the workspace.

GitHub Repo

No response

Steps to Reproduce

  1. Run npx create-nx-workspace@latest testwslatest
  2. Tested with those options:
    ✔ Which stack do you want to use? · angular
    ✔ Integrated monorepo, or standalone project? · integrated
    ✔ Application name · testwslatest
    ✔ Which bundler would you like to use? · webpack
    ✔ Default stylesheet format · css
    ✔ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? · Yes
    ✔ Test runner to use for end to end (E2E) tests · cypress
    ✔ Enable distributed caching to make your CI faster · No

But also failed with 17.0.2 and 17.0.3 and with other options (e.g. NestJs app, even with type "None")

Nx Report

Nx workspace not created, yet.

Failure Logs

There are no logs.

Package Manager Version

npm 9.5.1

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Operating System: WSL2 under Windows

@Markus-Ende
Copy link
Author

Maybe it just takes very long and I'm too impatient? Is there a way to get more logs?

@Ollitod
Copy link

Ollitod commented Nov 21, 2023

Same here. I executed create-nx-workspace@17.1.3 on Windows 10 and after an hour it is still stuck in "Creating your workspace".

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Nov 28, 2023
@Markus-Ende
Copy link
Author

Small updsate: v16 also doesn't work, last working version on my machine is 15.

@Markus-Ende
Copy link
Author

update: tried with v17.3.0, it still does not work

@schoggobaer
Copy link

schoggobaer commented Feb 2, 2024

It also did not work for me with the same command

ProductName:            macOS
ProductVersion:         14.2.1
BuildVersion:           23C71

@Markus-Ende
Copy link
Author

Another update: it did work on an older non-M1 macbook.

@Markus-Ende
Copy link
Author

Update: still not working with 18.2.4

@BaggersIO
Copy link

Same here. Still not working.

@Samaneh
Copy link

Samaneh commented Apr 13, 2024

I'm using Windows 10, node v20, taking more than one hour to generate the workspace :/

@matthew-shirey
Copy link

Is there a workaround... any? Suggested last version to use? I'm stuck here too and this seems like a rather severe blocker. I'm surprised that there's no helpful information here considering how long this one's been reported. Any help would greatly be appreciated. Thank you.

@viz
Copy link

viz commented May 3, 2024

Have encountered this today.
NX v18.3.4
Node v21.7.1
WSL2 Ubuntu 22.04.4 LTS

xxxx@DESKTOP-xxx:~/projects/learning$ npx create-nx-workspace ng-mf

NX Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Which stack do you want to use? · angular
✔ Integrated monorepo, or standalone project? · integrated
✔ Application name · ng-mf
✔ Which bundler would you like to use? · webpack
✔ Default stylesheet format · css
✔ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? · No
✔ Test runner to use for end to end (E2E) tests · cypress
✔ Set up CI with caching, distribution and test deflaking · skip
✔ Would you like remote caching to make your build faster? · skip

NX Creating your v18.3.4 workspace.

✔ Installing dependencies with npm
⠸ Creating your workspace in ng-mf

@ekawatani
Copy link

Getting the same result. I'm running it on WSL2 Ubuntu running nix dev shell, using NX v19.2.3.

image

@ekawatani
Copy link

Ok, maybe I was too early to post it. The command worked this time, but it took 27m57s. I know this since I use Starship to measure the length of a shell command. That's too slow, and something is definitely wrong.

@bhaugeea
Copy link

bhaugeea commented Jul 2, 2024

Currently running into this as well. Ubuntu 22 on x86. EDIT: finally worked, but took at least ~15 minutes.

@mshirey
Copy link

mshirey commented Jul 2, 2024

I just hit this one again. On Windows 11, this command worked fine. On an up-to-date Manjaro Linux, it just hangs. I left it for well over an hour with no progress. Is there any logging that can be turned on to maybe get a bit of feedback regarding what it's not doing?

@adyatlov
Copy link

I believe it's a bug. As far as I understand, the nx's post-install script is the main culprit. Here is the way I reproduce it.
Environment:

$ sw_vers
ProductName:            macOS
ProductVersion:         14.5
BuildVersion:           23F79

$ which node
/Users/adyatlov/.nvm/versions/node/v22.6.0/bin/node

$ node --version
v22.6.0

$ npx nx --version
Nx Version:
- Local: Not found
- Global: v19.5.7

Steps:

$ killall -9 node # to avoid possible interferences with previous runs

$ npx create-nx-workspace # chose all default options

 NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Where would you like to create your workspace? · org
✔ Which stack do you want to use? · none
✔ Package-based monorepo, integrated monorepo, or standalone project? · package-based
✔ Which CI provider would you like to use? · github

 NX   Creating your v19.5.7 workspace.

✔ Installing dependencies with npm
⠇ Creating your workspace in org # <-- it got stuck here

Troubleshooting steps:

# Press ^C
$ ps aux | grep "npm install"
...
adyatlov         14332   0.0  1.5 412357872 248832 s003  S     8:12PM   0:04.50 npm install # still running
$ killall -9 node # to clean up 
$ cd org
$ npm install # <-- it got stuck here again
# Press ^C
npm error code 130
npm error path /Users/adyatlov/tmp/org/node_modules/nx
npm error command failed
npm error command sh -c node ./bin/post-install
npm error A complete log of this run can be found in: /Users/adyatlov/.npm/_logs/2024-08-14T21_03_42_775Z-debug-0.log

Relevant logs:

2002 info run nx@19.5.7 postinstall node_modules/nx node ./bin/post-install
2003 info run nx@19.5.7 postinstall { code: 130, signal: null }
2004 verbose stack Error: command failed
2004 verbose stack     at promiseSpawn (/Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
2004 verbose stack     at spawnWithShell (/Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
2004 verbose stack     at promiseSpawn (/Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
2004 verbose stack     at runScriptPkg (/Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:77:13)
2004 verbose stack     at runScript (/Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
2004 verbose stack     at /Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:329:17
2004 verbose stack     at run (/Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:67:22)
2004 verbose stack     at /Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:84:9
2004 verbose stack     at new Promise (<anonymous>)
2004 verbose stack     at callLimit (/Users/adyatlov/.nvm/versions/node/v22.6.0/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:35:69)
2005 verbose pkgid nx@19.5.7
2006 error code 130
2007 error path /Users/adyatlov/tmp/org/node_modules/nx
2008 error command failed
2009 error command sh -c node ./bin/post-install
2010 silly unfinished npm timer reify 1723669422889
2011 silly unfinished npm timer reify:build 1723669424765
2012 silly unfinished npm timer build 1723669424765
2013 silly unfinished npm timer build:deps 1723669424766
2014 silly unfinished npm timer build:run:postinstall 1723669424774
2015 silly unfinished npm timer build:run:postinstall:node_modules/nx 1723669424774
2016 verbose cwd /Users/adyatlov/tmp/org
2017 verbose os Darwin 23.5.0
2018 verbose node v22.6.0
2019 verbose npm  v10.8.2
2020 verbose exit 130
2021 verbose code 130
2022 error A complete log of this run can be found in: /Users/adyatlov/.npm/_logs/2024-08-14T21_03_42_775Z-debug-0.log

Full logfile:
2024-08-14T21_03_42_775Z-debug-0.log

Note:
nx v19.4.0 works as expected.

Please contact me if you cannot reproduce the issue on your machine and you want to use my environment for debugging.

@Markus-Ende
Copy link
Author

I just got the exact same error message, using npm install in a project without existing node_modules.
postinstall is stuck and install never finishes.

npm verbose os Linux 5.15.153.1-microsoft-standard-WSL2
npm verbose node v22.3.0
npm verbose npm  v10.8.1

@Pedromigacz
Copy link

I've encountered this issue today as well.

npx create-nx-workspace
Need to install the following packages:
create-nx-workspace@20.0.0
Ok to proceed? (y) y


 NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Where would you like to create your workspace? · org
✔ Which stack do you want to use? · react
✔ What framework would you like to use? · nextjs
✔ Integrated monorepo, or standalone project? · integrated
✔ Application name · diet-it
✔ Would you like to use the App Router (recommended)? · Yes
✔ Would you like to use the src/ directory? · Yes
✔ Test runner to use for end to end (E2E) tests · none
✔ Default stylesheet format · tailwind
✔ Which CI provider would you like to use? · github

 NX   Creating your v20.0.0 workspace.

✔ Installing dependencies with npm
⠋ Creating your workspace in org

It hanged for 10 minutes, then I gave up.
WSL2 Node v22.1.0

@tonivj5
Copy link

tonivj5 commented Oct 15, 2024

Same here! After a bunch of runs it has worked...

@crowmagnumb
Copy link

Yup, I let it run for hours, and hours .... stuck on creating ....

@hmidmrii
Copy link

hmidmrii commented Oct 17, 2024

I am not sure if it's related but it happened to me the second time (still pending), the first time was fast and normal.
I am not sure if it's because both workspaces have the same name

@crowmagnumb
Copy link

I finally just let it go over night figuring what the heck and it just finished after like 16 hours! :)

@yhoungdev
Copy link

I finally just let it go over night figuring what the heck and it just finished after like 16 hours! :)

This is not normal

@yhoungdev
Copy link

Got same issue today also, but it was my network.

Try checking your network

@FabianGosebrink
Copy link
Contributor

FabianGosebrink commented Nov 29, 2024

I am also facing this issue currently.

Image

Stuck here since two days :( It is literally running for two days now :D

@Tobertet
Copy link

For anyone still having this issue, the problem in my case is related to npm. It is getting stuck. Changing to yarn made it work.

@ekawatani
Copy link

It could be the npm issue indeed. I no longer have this problem after upgrading npm to 10.9.1.

See npm/cli#7814

@michaelurban
Copy link

michaelurban commented Jan 3, 2025

It could be the npm issue indeed. I no longer have this problem after upgrading npm to 10.9.1.

I'm still having this issue with npm v10.9.1, v10.9.2, and v11.0.0.

@gustavostz
Copy link

To make it work, I had to execute the create command skipping Prettier, CI, and remote caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.