Skip to content

21.1.1 postinstall hangs on Windows 11 #31300

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

Open
1 of 4 tasks
svickers opened this issue May 21, 2025 · 5 comments
Open
1 of 4 tasks

21.1.1 postinstall hangs on Windows 11 #31300

svickers opened this issue May 21, 2025 · 5 comments
Assignees
Labels
priority: high High Priority (important issues which affect many people severely) scope: core core nx functionality type: bug

Comments

@svickers
Copy link

Current Behavior

When trying to install nx globally the postinstall step hangs forever. When breaking an error is printed about not being able to remove certain directories. I've tried both admin and non-admin mode running the console.

Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Users\\<user>\\AppData\\Roaming\\npm\\node_modules\\nx',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\<user>\AppData\Roaming\npm\node_modules\nx\node_modules\axios\lib\platform\browser\classes'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\<user>\\AppData\\Roaming\\npm\\node_modules\\nx\\node_modules\\axios\\lib\\platform\\browser\\classes'
npm warn cleanup     }
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '\\\\?\\C:\\Users\\<user>\\AppData\\Roaming\\npm\\node_modules\\nx\\node_modules',
npm warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\<user>\AppData\Roaming\npm\node_modules\nx\node_modules\@tybys'] {
npm warn cleanup       errno: -4048,
npm warn cleanup       code: 'EPERM',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: 'C:\\Users\\<user>\\AppData\\Roaming\\npm\\node_modules\\nx\\node_modules\\@tybys'
npm warn cleanup     }
npm warn cleanup   ]
npm warn cleanup ]

Expected Behavior

Expected to install

GitHub Repo

No response

Steps to Reproduce

  1. run npm add --global nx@latest --verbose
npm verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
npm info using [email protected]
npm info using [email protected]
npm verbose title npm add nx@latest
npm verbose argv "add" "--global" "nx@latest" "--loglevel" "verbose"
...
...
npm http cache brace-expansion@https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz 0ms (cache hit)
npm http cache ansi-colors@https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz 0ms (cache hit)
npm http cache ansi-regex@https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz 0ms (cache hit)
npm http cache balanced-match@https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz 0ms (cache hit)
npm http cache ansi-styles@https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz 0ms (cache hit)
npm info run [email protected] postinstall node_modules/nx node ./bin/post-install

Nx Report

Unable

Failure Logs

851 warn cleanup Failed to remove some directories [
851 warn cleanup   [
851 warn cleanup     '\\\\?\\C:\\Users\\<user>\\AppData\\Roaming\\npm\\node_modules\\nx\\node_modules',
851 warn cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\<user>\AppData\Roaming\npm\node_modules\nx\node_modules\@tybys'] {
851 warn cleanup       errno: -4048,
851 warn cleanup       code: 'EPERM',
851 warn cleanup       syscall: 'rmdir',
851 warn cleanup       path: 'C:\\Users\\<user>\\AppData\\Roaming\\npm\\node_modules\\nx\\node_modules\\@tybys'
851 warn cleanup     }
851 warn cleanup   ]
851 warn cleanup ]
852 verbose stack Error: command failed
852 verbose stack     at promiseSpawn (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:22:22)
852 verbose stack     at spawnWithShell (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:124:10)
852 verbose stack     at promiseSpawn (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
852 verbose stack     at runScriptPkg (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:77:13)
852 verbose stack     at runScript (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:12)
852 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\rebuild.js:329:17
852 verbose stack     at run (C:\Program Files\nodejs\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:67:22)
852 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:84:9
852 verbose stack     at new Promise (<anonymous>)
852 verbose stack     at callLimit (C:\Program Files\nodejs\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:35:69)
853 verbose pkgid [email protected]
854 error code 3221225786
855 error path C:\Users\<user>\AppData\Roaming\npm\node_modules\nx
856 error command failed
857 error command C:\WINDOWS\system32\cmd.exe /d /s /c node ./bin/post-install
858 error ^C

Package Manager Version

[email protected]

Operating System

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

Additional Information

I've tried deleting the @tybys directory referenced manually but on next install it gets recreated again and can't be deleted by the installer.

@pkasarda
Copy link

it is happening also after reboot?

@svickers
Copy link
Author

it is happening also after reboot?

Yes, rebooted and even went as far as uninstalling node completely and starting fresh.

@tpiere
Copy link

tpiere commented May 22, 2025

I believe I'm seeing the same problem in Github actions. It just hangs forever on npm info run [email protected] postinstall node_modules/nx node ./bin/post-install when I run npm ci --verbose

My runner is Ubuntu 24.04.2 LTS.
Node: v22.16.0
npm: 10.9.2

@claudiobianco
Copy link

I believe I'm seeing the same problem in Github actions. It just hangs forever on npm info run [email protected] postinstall node_modules/nx node ./bin/post-install when I run npm ci --verbose

My runner is Ubuntu 24.04.2 LTS. Node: v22.16.0 npm: 10.9.2

Not sure if this is related but I had a similar issue, when installing my project with npm i --no-optional.

@FrozenPandaz FrozenPandaz added scope: core core nx functionality priority: high High Priority (important issues which affect many people severely) labels May 27, 2025
@claust
Copy link

claust commented May 28, 2025

I see a similar issue when trying to install the latest nx. It hangs on post-install. Notice that the Windows-specific binaries failed to install:

D:<repo>>npm add --global nx@latest --verbose
npm verbose cli C:\nvm4w\nodejs\node.exe C:\nvm4w\nodejs\node_modules\npm\bin\npm-cli.js
npm info using [email protected]
npm info using [email protected]
npm verbose title npm add nx@latest
npm verbose argv "add" "--global" "nx@latest" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:D:\packages\npm_logs\2025-05-28T06_27_49_307Z-
npm verbose logfile D:\packages\npm_logs\2025-05-28T06_27_49_307Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/nx 171ms (cache updated)
npm http fetch GET 200 https://registry.npmjs.org/nx 45ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/enquirer 109ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/flat 121ms (cache revalidated)
...
npm http fetch GET 200 https://registry.npmjs.org/once 31ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/wrappy 24ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/clone 27ms (cache revalidated)
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-win32-x64-msvc
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-win32-arm64-msvc
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-linux-x64-musl
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-linux-x64-gnu
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-linux-arm64-musl
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-linux-arm64-gnu
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-linux-arm-gnueabihf
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-freebsd-x64
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-darwin-x64
npm verbose reify failed optional dependency C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@nx\nx-darwin-arm64
npm http cache sprintf-js@https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz 0ms (cache hit)
npm http cache get-caller-file@https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz 0ms (cache hit)
npm http cache y18n@https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz 0ms (cache hit)
...
npm http cache nx@https://registry.npmjs.org/nx/-/nx-21.1.2.tgz 0ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz 393ms (cache miss)

npm info run [email protected] postinstall node_modules/nx node ./bin/post-install
npm info run [email protected] postinstall { code: 3221225786, signal: null }
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup 'C:\Users\\AppData\Local\nvm\v20.18.3\node_modules\nx',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules@jest'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\Users\\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules\@jest'
npm warn cleanup }
npm warn cleanup ],
npm warn cleanup [
npm warn cleanup 'C:\Users\\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules\js-yaml',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules\js-yaml\node_modules'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\Users\\AppData\Local\nvm\v20.18.3\node_modules\nx\node_modules\js-yaml\node_modules'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
npm verbose stack Error: command failed
npm verbose stack at promiseSpawn (C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:22:22)
npm verbose stack at spawnWithShell (C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:124:10)
npm verbose stack at promiseSpawn (C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:12:12)
npm verbose stack at runScriptPkg (C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules@npmcli\run-script\lib\run-script-pkg.js:79:13)
npm verbose stack at runScript (C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules@npmcli\run-script\lib\run-script.js:9:12)
npm verbose stack at C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\rebuild.js:331:17
npm verbose stack at run (C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:67:22)
npm verbose stack at C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:84:9
npm verbose stack at new Promise ()
npm verbose stack at callLimit (C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\npm\node_modules\promise-call-limit\dist\commonjs\index.js:35:69)
npm verbose pkgid [email protected]
npm error code 3221225786
npm error path C:\Users<user>\AppData\Local\nvm\v20.18.3\node_modules\nx
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node ./bin/post-install
npm error ^C
npm verbose cwd D:<repo>
npm verbose os Windows_NT 10.0.26100
npm verbose node v20.18.3
npm verbose npm v11.4.1
npm verbose exit 3221225786
npm verbose code 3221225786
npm error A complete log of this run can be found in: D:\packages\npm_logs\2025-05-28T06_27_49_307Z-debug-0.log
^C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high High Priority (important issues which affect many people severely) scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

8 participants