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

Unable to install npm package on Windows #1050

Open
DanTup opened this issue Nov 26, 2023 · 1 comment
Open

Unable to install npm package on Windows #1050

DanTup opened this issue Nov 26, 2023 · 1 comment

Comments

@DanTup
Copy link

DanTup commented Nov 26, 2023

If I run npm install -g @sourcegraph/src I get the following output:

PS C:\Dev\Sourcegraph\cody> npm install -g @sourcegraph/src
npm ERR! code 1
npm ERR! path C:\Users\danny\AppData\Roaming\npm\node_modules\@sourcegraph\src
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node install.js
npm ERR! Downloading https://github.com/sourcegraph/src-cli/releases/download/5.2.1/src-cli_5.2.1_windows_amd64.tar.gz
npm ERR! node:internal/fs/utils:350
npm ERR!     throw err;
npm ERR!     ^
npm ERR!
npm ERR! Error: ENOENT: no such file or directory, chmod 'src.exe'
npm ERR!     at Object.chmodSync (node:fs:1991:3)
npm ERR!     at Unpack.<anonymous> (C:\Users\danny\AppData\Roaming\npm\node_modules\@sourcegraph\src\install.js:60:36)
npm ERR!     at Unpack.emit (node:events:517:28)
npm ERR!     at C:\Users\danny\AppData\Roaming\npm\node_modules\@sourcegraph\src\node_modules\tar\lib\parse.js:235:25
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
npm ERR!   errno: -4058,
npm ERR!   syscall: 'chmod',
npm ERR!   code: 'ENOENT',
npm ERR!   path: 'src.exe'
npm ERR! }
npm ERR!
npm ERR! Node.js v18.18.2

npm ERR! A complete log of this run can be found in: C:\Users\danny\AppData\Local\npm-cache\_logs\2023-11-26T12_06_26_509Z-debug-0.log

It's not clear to me if the download is failing (that URL appears correct) or if chmod is failing to find src.exe. There's not much more detail in the full log:

2023-11-26T12_06_26_509Z-debug-0.log

I'm using Windows 11:

image

With these versions of node/npm:

PS C:\Dev\Sourcegraph\cody> node --version
v18.18.2
PS C:\Dev\Sourcegraph\cody> npm --version
10.1.0
@DanTup DanTup changed the title Unable to install on Windows Unable to install npm package on Windows Nov 26, 2023
@olafurpg
Copy link
Member

Thank you for reporting! Seems like this might get fixed by using executableName here instead of "src"

https://github.com/sourcegraph/src-cli/blob/main/npm-distribution/install.js#L59

I'll try to reproduce and fix on my Windows computer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants