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

nx commands yield "process exited with code 1" #8902

Closed
GaryB432 opened this issue Feb 8, 2022 · 20 comments
Closed

nx commands yield "process exited with code 1" #8902

GaryB432 opened this issue Feb 8, 2022 · 20 comments
Labels
blocked: retry with latest Retry with latest release or head. outdated scope: core core nx functionality type: bug

Comments

@GaryB432
Copy link

GaryB432 commented Feb 8, 2022

Current Behavior

nx commands are leaving open a cmd.exe window with [process exited with code 1] and some node_modules on Windows.

Expected Behavior

Nx commands, e.g. nx affected:build, should run and complete without leaving things open

Steps to Reproduce

mkdir nx-process-exited
npx create-nx-workspace@latest --preset empty code-1
cd .\code-1\
npm i @nrwl/js -D
nx g @nrwl/js:application show-result
nx affected:build

Failure Logs

a cmd.exe window with [process exited with code 1] is left open (maybe 2 of them)
also. I observe that these files are left open and are not deletable without a restart

  • C:\code-1\node_modules\@parcel\watcher\prebuilds\win32-x64\node.napi.glibc.node
  • C:\code-1\node_modules\@nrwl\workspace\src\core\project-graph\daemon\client

I am not aware of any logs

Environment

Node : 14.17.5
OS : win32 x64
npm : 7.24.1

nx : 13.7.3
@nrwl/angular : undefined
@nrwl/cli : 13.7.3
@nrwl/cypress : undefined
@nrwl/detox : undefined
@nrwl/devkit : 13.7.3
@nrwl/eslint-plugin-nx : 13.7.3
@nrwl/express : undefined
@nrwl/jest : 13.7.3
@nrwl/js : 13.7.3
@nrwl/linter : 13.7.3
@nrwl/nest : undefined
@nrwl/next : undefined
@nrwl/node : undefined
@nrwl/nx-cloud : 13.1.2
@nrwl/react : undefined
@nrwl/react-native : undefined
@nrwl/schematics : undefined
@nrwl/storybook : undefined
@nrwl/tao : 13.7.3
@nrwl/web : undefined
@nrwl/workspace : 13.7.3
typescript : 4.5.5
rxjs : 6.5.5

@G233
Copy link

G233 commented Feb 11, 2022

maybe you can see
#8646

@itspers
Copy link

itspers commented Feb 14, 2022

Same thing happend in Windows Terminal - it spawn new window with "process exited with code 1" first time NX daemon in started. After OS restart or "nx clear-cache" - appears again.

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Feb 14, 2022
@GaryB432
Copy link
Author

Oh 'nx clear-cache' is a more convenient workaround than restarting while this is worked.

@itspers
Copy link

itspers commented Feb 14, 2022

Oh 'nx clear-cache' is a more convenient workaround than restarting while this is worked.

For me its not workaround, but one of two things that cases window to appear again. It dont cause any crashes for me, just spawns annoying window. I just close it and return to main terminal.

As i see it, nx daemon spawns some process on start. which opens in Windows as new window. Clear-cache or OS restart kills daemon - so next time window appear again. Although im not sure its its causes by new NX version on new Windows Terminal...

@GaryB432
Copy link
Author

I see. Yes the restarting is necessary because my project is so new that I'm still churning my node_modules folder. Those files therein mentioned above are left in use. Perhaps I could kill some process to close them but it's beyond my capabilities to find which. I am also using Windows Terminal. And PowerShell FWIW.

@LuckeeDev
Copy link

I'm having the same issue (#9671, which I now closed since it was a duplicate of this). Is there any update or workaround available?

@GaryB432
Copy link
Author

GaryB432 commented Apr 9, 2022

@LuckeeDev your issue mentions NextJS. I found the problem could be reproduced with just a nrwl/js application. Glad to see other OS : win32 x64 users!

@LuckeeDev
Copy link

Yes, I mentioned NextJS because I only tested this in a workspace with it. However, I suspect this might be related to NX on Windows and not to a specific NX package.

@LoaderB0T
Copy link

Hello there,
I have the same issue. I have an Angular Application (No NextJS or React anywhere).
A terminal window opens after the first Nx command with exit code 1.

For me, the file node_modules\\@swc\\core-win32-x64-msvc\\swc.win32-x64-msvc.node' is locked (which means I cannot install any yarn/npm packages). The lock is resolved when I close VSCode and type yarn install in a new Terminal window.

Opening the workspace in VSCode is enough to lock the file (without running any Nx command), however, this problem disappeared after uninstalling the Nx console extension for VSCode.

Using:

  • Windows 11 (21H2 Build 22000.613)
  • Windows Terminal 1.12.10733.0
  • Nx 13.8.5
  • VSCode 1.66.2

@fwauters
Copy link

fwauters commented Apr 26, 2022

Hello, I have a similar issue with a Nx NestJS/Angular application. When I run nx serve api, a Windows Terminal opens with [process exited with code 1 (0x00000001)].

I'm using:

  • Windows 11 (21H2 Build 22000.613)
  • VSCode 1.66.2
  • Nx 13.9.6

Edit : The problem only seems to happen the first time I run the command after turning on my pc.

@nhhockeyplayer
Copy link

This is happening on MacBook

nx report

 >  NX   Report complete - copy this into the issue template

   Node : 16.15.1
   OS   : darwin x64
   yarn : 1.22.18
   
   nx : 14.4.2
   @nrwl/angular : 14.4.2
   @nrwl/cypress : 14.4.2
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.4.2
   @nrwl/eslint-plugin-nx : 14.4.2
   @nrwl/express : 14.4.2
   @nrwl/jest : 14.4.2
   @nrwl/js : 14.4.2
   @nrwl/linter : 14.4.2
   @nrwl/nest : 14.4.2
   @nrwl/next : Not Found
   @nrwl/node : 14.4.2
   @nrwl/nx-cloud : 14.2.0
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : 8.12.11
   @nrwl/storybook : 14.4.2
   @nrwl/web : 14.4.2
   @nrwl/workspace : 14.4.2
   typescript : 4.7.4
   ---------------------------------------
   Community plugins:
   	 @fortawesome/angular-fontawesome: 0.11.1
   	 @ionic/angular: 6.1.13
   	 @ngrx/component: 14.0.1
   	 @ngrx/component-store: 14.0.1
   	 @ngrx/effects: 14.0.1
   	 @ngrx/entity: 14.0.1
   	 @ngrx/router-store: 14.0.1
   	 @ngrx/store: 14.0.1
   	 @nxtend/capacitor: 13.0.0
   	 @nxtend/ionic-angular: 13.1.0
   	 @storybook/angular: 6.5.9
   	 angular-builder-custom-terser-options: 1.0.1
   	 @compodoc/compodoc: 1.1.19
   	 @ngrx/schematics: 14.0.1
   	 @ngrx/store-devtools: 14.0.1
   	 @nxtend/capacitor: 13.0.0
   	 @storybook/angular: 6.5.9

@kekel87
Copy link

kekel87 commented Dec 18, 2022

Hello, I also have a terminal that opens when I run an NX command on Windows 11.
I have the impression that it's the NX Deamon that launches.

I don't have this anymore when I disable with "useDaemonProcess": false or NX_DAEMON false as env var.

@pf1gura
Copy link
Contributor

pf1gura commented Dec 19, 2022

I can confirm that disabling the daemon resolves the issue, but that is not ideal.

@itspers
Copy link

itspers commented Feb 2, 2023

And almost a year, and it became even worse - running prisma migrate spams now dozen of CMD flashing windows for almost a minute...

@FullDream
Copy link

did you find a solution to this problem?
"useDaemonProcess": false - doesn't help

@itspers
Copy link

itspers commented Feb 26, 2023

@FullDream its maybe fixed by #10822 (comment), was included in 15.7.0 changelog - but can't say for sure - that release bring again new problems - reverted back...

@FrozenPandaz FrozenPandaz added the blocked: retry with latest Retry with latest release or head. label Mar 1, 2023
@FrozenPandaz
Copy link
Collaborator

This should have been fixed with: #14965 Can you please retry with the latest version?

@FullDream
Copy link

@FullDream its maybe fixed by #10822 (comment), was included in 15.7.0 changelog - but can't say for sure - that release bring again new problems - reverted back...

installing 15.8.1 fixed the issue

@AgentEnder
Copy link
Member

My impression is that this should be fixed in latest. With @FullDream confirming it, I'm going to close this out as we have addressed the root cause. If folks are still experiencing the problem, feel free to comment and it can be reopened.

@github-actions
Copy link

github-actions bot commented Apr 2, 2023

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: retry with latest Retry with latest release or head. outdated scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests