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

Failed to install with npm on ubuntu. #7140

Open
1 of 2 tasks
milk-bottle-liyu opened this issue Dec 25, 2024 · 1 comment
Open
1 of 2 tasks

Failed to install with npm on ubuntu. #7140

milk-bottle-liyu opened this issue Dec 25, 2024 · 1 comment
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer

Comments

@milk-bottle-liyu
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: NA
  • Local OS: Ubuntu 22.04
  • Remote OS: NA
  • Remote Architecture: NA
  • code-server --version: 4.96.2

Steps to Reproduce

  1. install dependency
  2. run npm install --loglevel verbose --global code-server

Expected

Successful installation.

Actual

Failed installation.

Logs

npm info run [email protected] install node_modules/code-server/node_modules/argon2 node-pre-gyp install --fallback-to-build
npm info run [email protected] install { code: 0, signal: null }
npm info run [email protected] postinstall node_modules/code-server sh ./postinstall.sh
npm info run [email protected] postinstall { code: 1, signal: null }
npm verbose stack Error: command failed
npm verbose stack     at promiseSpawn (/mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
npm verbose stack     at spawnWithShell (/mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
npm verbose stack     at promiseSpawn (/mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
npm verbose stack     at runScriptPkg (/mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:77:13)
npm verbose stack     at runScript (/mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
npm verbose stack     at /mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:329:17
npm verbose stack     at run (/mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:67:22)
npm verbose stack     at /mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:84:9
npm verbose stack     at new Promise (<anonymous>)
npm verbose stack     at callLimit (/mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/lib/node_modules/npm/node_modules/promise-call-limit/dist/commonjs/index.js:35:69)
npm verbose pkgid [email protected]
npm error code 1
npm error path /mnt/data_2/pingyu/nodejs/node_global/lib/node_modules/code-server
npm error command failed
npm error command sh -c sh ./postinstall.sh
npm error Installing Code dependencies...
npm error User agent: npm/10.8.2 node/v20.18.1 linux x64 workspaces/false
npm error You may not have the required dependencies to build the native modules.
npm error Please see https://github.com/coder/code-server/blob/main/docs/npm.md
npm error npm verbose cli /mnt/data_2/pingyu/tools/node-v20.18.1-linux-x64/bin/node /data_2/pingyu/tools/node-v20.18.1-linux-x64/bin/npm
npm error npm info using [email protected]
npm error npm info using [email protected]
npm error npm verbose title npm install
npm error npm verbose argv "install" "--unsafe-perm" "--omit" "dev"
npm error npm verbose logfile logs-max:10 dir:/data_2/pingyu/nodejs/node_cache/_logs/2024-12-25T15_32_13_644Z-
npm error npm verbose logfile /data_2/pingyu/nodejs/node_cache/_logs/2024-12-25T15_32_13_644Z-debug-0.log
npm error npm http fetch GET 200 https://registry.npmjs.org/@microsoft%2f1ds-core-js 3487ms (cache miss)
npm error npm http fetch GET 200 https://registry.npmjs.org/@microsoft%2f1ds-post-js 2391ms (cache miss)

Screenshot/Video

No response

Does this bug reproduce in native VS Code?

This cannot be tested in native VS Code

Does this bug reproduce in GitHub Codespaces?

This cannot be tested in GitHub Codespaces

Are you accessing code-server over a secure context?

  • I am using a secure context.

Notes

nodejs version: 20.18.1
npm version: 10.8.2

when run npm config set python python3, it outputs npm error python is not a valid npm option.

@milk-bottle-liyu milk-bottle-liyu added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Dec 25, 2024
@code-asher
Copy link
Member

Interesting, apparently npm 9 no longer allows setting that option. It seems now it has to be done with export npm_config_python=/path/to/executable/python. I am not sure that will fix the problem, but could you try that?

I tried to run the install myself, but I am getting a completely different error...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants