Description
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Local OS: Windows
Steps to Reproduce
- Install the dependencies of VS2022 and npm
- run
npm i code-server -g
- Error message are produced
Expected
Code-server should be installed and ready to be used.
Actual
C:\Users\USER\Desktop\servers\vscode>npm install code-server -g
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup '\\?\C:\Users\USER\AppData\Roaming\npm\node_modules\code-server',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules'] {
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\code-server\node_modules'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
npm error code 1
npm error path C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | win32 | x64
npm error gyp info find Python using Python version 3.13.5 found at "C:\Users\USER\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\python.exe"
npm error gyp info find VS using VS2022 (17.14.36212.18) found at:
npm error gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm error gyp info find VS run with --verbose for detailed information
npm error gyp info spawn C:\Users\USER\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\python.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'msvs',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2\build\config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp\addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\Users\USER\AppData\Local\node-gyp\Cache\22.16.0\include\node\common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=C:\Users\USER\AppData\Local\node-gyp\Cache\22.16.0',
npm error gyp info spawn args '-Dnode_gyp_dir=C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=C:\\Users\\USER\\AppData\\Local\\node-gyp\\Cache\\22.16.0\\<(target_arch)\\node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2\build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: gyp
failed with exit code: 1
npm error gyp ERR! stack at ChildProcess. (C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:317:18)
npm error gyp ERR! stack at ChildProcess.emit (node:events:518:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm error gyp ERR! System Windows_NT 10.0.22000
npm error gyp ERR! command "C:\nvm4w\nodejs\node.exe" "C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm error gyp ERR! cwd C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2
npm error gyp ERR! node -v v22.16.0
npm error gyp ERR! node-gyp -v v11.0.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: C:\Users\USER\AppData\Local\npm-cache_logs\2025-06-18T19_48_19_610Z-debug-0.log
C:\Users\USER\Desktop\servers\vscode>npm install --global code-server
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup '\\?\C:\Users\USER\AppData\Roaming\npm\node_modules\code-server',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\lib\vscode\out\vs\workbench\browser\parts'] {
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\code-server\lib\vscode\out\vs\workbench\browser\parts'
npm warn cleanup }
npm warn cleanup ],
npm warn cleanup [
npm warn cleanup 'C:\Users\USER\AppData\Roaming\npm\node_modules\code-server',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\lib\vscode\out\vs\workbench\contrib\welcomeGettingStarted\common\media\notebookThemes'] {
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\code-server\lib\vscode\out\vs\workbench\contrib\welcomeGettingStarted\common\media\notebookThemes'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
npm error code 1
npm error path C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | win32 | x64
npm error gyp info find Python using Python version 3.13.5 found at "C:\Users\USER\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\python.exe"
npm error gyp info find VS using VS2022 (17.14.36212.18) found at:
npm error gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm error gyp info find VS run with --verbose for detailed information
npm error gyp info spawn C:\Users\USER\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\python.exe
npm error gyp info spawn args [
npm error gyp info spawn args 'C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'msvs',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2\build\config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp\addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args 'C:\Users\USER\AppData\Local\node-gyp\Cache\22.16.0\include\node\common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=C:\Users\USER\AppData\Local\node-gyp\Cache\22.16.0',
npm error gyp info spawn args '-Dnode_gyp_dir=C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=C:\\Users\\USER\\AppData\\Local\\node-gyp\\Cache\\22.16.0\\<(target_arch)\\node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2\build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: gyp
failed with exit code: 1
npm error gyp ERR! stack at ChildProcess. (C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:317:18)
npm error gyp ERR! stack at ChildProcess.emit (node:events:518:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm error gyp ERR! System Windows_NT 10.0.22000
npm error gyp ERR! command "C:\nvm4w\nodejs\node.exe" "C:\Users\USER\AppData\Local\nvm\v22.16.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm error gyp ERR! cwd C:\Users\USER\AppData\Roaming\npm\node_modules\code-server\node_modules\argon2
npm error gyp ERR! node -v v22.16.0
npm error gyp ERR! node-gyp -v v11.0.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: C:\Users\USER\AppData\Local\npm-cache_logs\2025-06-18T19_53_29_020Z-debug-0.log
Logs
Screenshot/Video
No response
Does this bug reproduce in native VS Code?
No, this works as expected in native VS Code
Does this bug reproduce in GitHub Codespaces?
Yes, this is also broken in GitHub Codespaces
Are you accessing code-server over a secure context?
- I am using a secure context.
Notes
No response