nx
nx copied to clipboard
Error Popup on every nx command (probably from node_modules\nx\src\daemon\server\start.js)
Current Behavior
When running any nx command, like nx run my-app:build or nx run my-app:test for the first time (after a reboot, for instance) a cmd window pops up, simply stating [process exited with code 1 (0x00000001)]:

The run still seemingly completes correctly. After that every subsequent run of any nx command completes without error.
On closer inspection I found that a node process is spawned and called with the following arguments:
"C:\Program Files\nodejs\node.exe" C:\my-workspace\node_modules\nx\src\daemon\server\start.js
This process persists even after closing the terminal. Killing this process manually and then running any nx command makes the error come back.
Expected Behavior
No cmd windows with errors pop up.
Steps to Reproduce
This was encountered on a Windows machine version 21H2 (OS Build 22000.739). Used shell was PowerShell Core 7.2.4 AND regular PowerShell 5.1.22000.653
Repro:
- run
npx create-nx-workspace@latest test-workspace, chooseangularandscssand cloud integration. - run
nx run my-app:test - Error should appear
Environment
nx report of created workspace:
Node : 16.15.0
OS : win32 x64
npm : 8.5.5
nx : 14.3.6
@nrwl/angular : 14.3.6
@nrwl/cypress : 14.3.6
@nrwl/detox : Not Found
@nrwl/devkit : 14.3.6
@nrwl/eslint-plugin-nx : 14.3.6
@nrwl/express : Not Found
@nrwl/jest : 14.3.6
@nrwl/js : 14.3.6
@nrwl/linter : 14.3.6
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : 14.1.2
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.3.6
@nrwl/web : 14.3.6
@nrwl/workspace : 14.3.6
typescript : 4.7.4
---------------------------------------
Community plugins:
This also happens to me. The curious thing is that with the NX Console Plugin installed it spawns a window for the error, but if the extension is disabled it only shows an error inside VSCode. It also stops showing after some time, after VSCode is closed and opened again.
PowerShell Core 7.2.5
Windows 11 22H2
VSCode 1.68.1
Node: 18.4.0
npm 8.12.2
"@nrwl/angular": "^14.3.6",
"@nrwl/cli": "14.3.6",
"@nrwl/cypress": "14.3.6",
"@nrwl/eslint-plugin-nx": "14.3.6",
"@nrwl/express": "^14.3.6",
"@nrwl/jest": "14.3.6",
"@nrwl/linter": "14.3.6",
"@nrwl/node": "14.3.6",
"@nrwl/workspace": "14.3.6",
This happens to me too. Since that one node process is never killed after build script, it blocks the dist folder from being rewritten on next build script. Apparently NX thinks the project has no changes made, so it skips building and uses the one from cache - thus leaving you with an outdated build. To fix that you have to manually kill the remaining node process.
NX report:
Node : 16.12.0
OS : win32 x64
yarn : 1.22.17
nx : 14.3.3
@nrwl/angular : Not Found
@nrwl/cypress : 14.3.3
@nrwl/detox : Not Found
@nrwl/devkit : 14.3.3
@nrwl/eslint-plugin-nx : 14.3.3
@nrwl/express : Not Found
@nrwl/jest : 14.3.3
@nrwl/js : 14.3.3
@nrwl/linter : 14.3.3
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : 14.3.3
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : 14.3.3
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.3.3
@nrwl/web : 14.3.3
@nrwl/workspace : 14.3.3
typescript : 4.7.3
We have tried to reproduce this but have not been able to. :disappointed:
In https://github.com/nrwl/nx/issues/11247, the user was using the newer Windows Terminal but here I see people are using Powershell + Powershell Core :thinking:
If anybody else has information that might help us reproduce this, please share! We will continue to try to reproduce it with any additional information provided.
We have tried to reproduce this but have not been able to. ๐
In #11247, the user was using the newer Windows Terminal but here I see people are using Powershell + Powershell Core ๐ค
If anybody else has information that might help us reproduce this, please share! We will continue to try to reproduce it with any additional information provided.
I also posted above. I am on Windows 11, with Windows Terminal, PowerShell 7.2.5. I solved the issue with the popup by disabling the "daemon" in nx.json:
nx.json
...
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"useDaemonProcess": false
}
}
},
...
I hope this can shine some light on the problem, but I think this is more of a workaround than a full solution.
Edit: I just tried creating a new nx workspace, with a base angular app. When I open the project in VSCode, the terminal window opens up immediately with the error.
Install finishes at around 2:30
https://user-images.githubusercontent.com/56246797/181847367-911582cf-78cd-42b0-89e9-96982cd393e0.mp4
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐
Not a stale.
@FrozenPandaz
Windows just gave me this popup, I don't think it is related, just wanted to document it.

You can check my exact setup here in the video
We have tried to reproduce this but have not been able to. ๐ In #11247, the user was using the newer Windows Terminal but here I see people are using Powershell + Powershell Core ๐ค If anybody else has information that might help us reproduce this, please share! We will continue to try to reproduce it with any additional information provided.
I also posted above. I am on Windows 11, with Windows Terminal, PowerShell 7.2.5. I solved the issue with the popup by disabling the "daemon" in nx.json:
nx.json ... "tasksRunnerOptions": { "default": { "runner": "nx/tasks-runners/default", "options": { "cacheableOperations": ["build", "lint", "test", "e2e"], "useDaemonProcess": false } } }, ...I hope this can shine some light on the problem, but I think this is more of a workaround than a full solution.
Edit: I just tried creating a new nx workspace, with a base angular app. When I open the project in VSCode, the terminal window opens up immediately with the error.
Install finishes at around 2:30 deamon.mp4
Also now having the same problems as #11247 After using nx generator to add libs / components. 8-10 console windows open and then immediately close again. That was probably there from the beginning, but I haven't used the generators in a while.
Also recently upgraded to node 16.17.0, but problem still persists.
I've spent some more time analyzing the problem.
When navigating to an Nx Project and running nx daemon --start the same problem as described initially appears. That is, a console window spawns that simply states [process exited with code 1 (0x00000001)].
Running nx daemon after that, however, prints Nx Daemon is currently running: and then a link to the logs and a ProcessId.
Using nx daemon --start --background=false to run the daemon in the current process does NOT produce any errors or popups.
I've also tried debugging the daemon.js, but since the error only happens when the code that causes the error runs in the background I've not gotten very far.
@FrozenPandaz does any of this help with troubleshooting the issue on your side?
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐
Not stale.
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐
Not stale, and has gotten much worse with the last update.
As far as I can see, the --background=false flag does not exists/work anymore. I couldn't find any reference to it in the docs or nx daemon help anymore and using the flag still tries to run the daemon in a background process.
All my colleagues are having the same problem on their windows machines. There's no way to work with the nx daemon in its current state and the only course of action is to just disable it.
Please take another look at the problem.
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐
I can only agree with @Jejuni. It has become worse on Windows. It would be great if you can fix that. Please do not stale.
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐
Not stale. @FrozenPandaz any new developments regarding this?
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐
Not stale.
I'd like to share a video of what this looks like for me, running Lerna v6.0.3 on Windows 11. Using git bash in Windows Terminal, but also does the same when run via powershell directly.
https://user-images.githubusercontent.com/6275952/203854975-105242c8-e449-4f89-ad4b-865ed8b24e05.mp4
The worst part is that when the new terminals open, they take focus from whatever app you are working on, making it impossible to use my computer when running tasks in Lerna/Nx.
I'd like to share a video of what this looks like for me, running Lerna v6.0.3 on Windows 11. Using git bash in Windows Terminal, but also does the same when run via powershell directly. nx-lerna-opening-tabs.mp4
The worst part is that when the new terminals open, they take focus from whatever app you are working on, making it impossible to use my computer when running tasks in Lerna/Nx.
Not a fix per see, but you might mitigate this by changing this settings in the terminal, to make it so that the tab doesn't persist.

@krokofant Thanks - I already had it set like that earlier, but the opening tabs still steal focus even though they immediately close, so unfortunately it is still just as unusable :(
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐
Still an issue.
I also have the Command Prompt Pinata ๐ช , but I even have it when saving a file that's monitored by Nx.. It's driving me crazy ๐คฏ
I have the same problem when working in VSCode on Windows 11. It always opens up terminal windows that close again immediately but as they steal focus it is basically not possible to work with it.
This issue is really embarrassing when trying to promote nx in a demo or so. Kills my machine with popups. Iโm now afraid to demo anything nx on windows. ๐ฟ
Out of curiosity
- what node package manager is everyone using?
- Are u using workspaces?
Yarn:yes
@jbadeau Yes, yarn v1.22.19, with workspaces (via Lerna)
I have it with npm and yarn. Not using workspaces. It also seems not related to vscode, the popups also pop up when using nx commands in the terminal.