microsoft/vscode-vsce

Installation failed on Alpine with @vscode/vsce-sign-alpine-x64 package

StidOfficial opened this issue · 6 comments

The install failed on Alpine Linux v3.20 with npm install command.

Prerequisite :

apk add npm

Install command :

# npm i -g @vscode/vsce
npm error code 1
npm error path /usr/local/lib/node_modules/@vscode/vsce/node_modules/@vscode/vsce-sign
npm error command failed
npm error command sh -c node ./src/postinstall.js
npm error [@vscode/vsce-sign] Failed to find package "@vscode/vsce-sign-alpine-x64" on the file system
npm error
npm error This can happen if you use the "--no-optional" flag. The "optionalDependencies"
npm error package.json feature is used to install the correct binary executable
npm error for your current platform. This install script will now attempt to work around
npm error this. If that fails, you need to remove the "--no-optional" flag to use @vscode/vsce-sign.
npm error
npm error [@vscode/vsce-sign] Trying to install package "@vscode/vsce-sign-alpine-x64" using npm
npm error [@vscode/vsce-sign] Failed to install package "@vscode/vsce-sign-alpine-x64" using npm: Command failed: npm install --loglevel=error --prefer-offline --no-audit --progress=false @vscode/vsce-sign-alpine-x64@2.0.2
npm error npm error code EBADPLATFORM
npm error npm error notsup Unsupported platform for @vscode/vsce-sign-alpine-x64@2.0.2: wanted {"os":"alpine","cpu":"x64"} (current: {"os":"linux","cpu":"x64"})
npm error npm error notsup Valid os:   alpine
npm error npm error notsup Actual os:  linux
npm error npm error notsup Valid cpu:  x64
npm error npm error notsup Actual cpu: x64
npm error npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-26T19_03_18_845Z-debug-0.log
npm error
npm error [@vscode/vsce-sign] Trying to download "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz"
npm error [@vscode/vsce-sign] Failed to download "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz": AggregateError
npm error Failed to install package "@vscode/vsce-sign-alpine-x64"
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-26T19_03_16_874Z-debug-0.log

Work around :

# npm i -g @vscode/vsce --os alpine
changed 206 packages in 2s

50 packages are looking for funding
  run `npm fund` for details

@StidOfficial Following last step should have succeeded

npm error [@vscode/vsce-sign] Trying to download "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz"
npm error [@vscode/vsce-sign] Failed to download "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz": AggregateError
npm error Failed to install package "@vscode/vsce-sign-alpine-x64"
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-26T19_03_16_874Z-debug-0.log

It seems failing to download from https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz - Can you please check downloading manually? Can you also please share the complete log in /root/.npm/_logs/2024-09-26T19_03_16_874Z-debug-0.log

I can download the file :

# curl https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz -o /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 6739k  100 6739k    0     0  6990k      0 --:--:-- --:--:-- --:--:-- 6984k

2024-09-27T17_16_23_296Z-debug-0.log

Hmm, it was not clear what caused the download to fail. Can you please try installing npm install @vscode/vsce-sign package in some dummy node folder?

No :

# npm install @vscode/vsce-sign
npm error code 1
npm error path /test/node_modules/@vscode/vsce-sign
npm error command failed
npm error command sh -c node ./src/postinstall.js
npm error [@vscode/vsce-sign] Failed to find package "@vscode/vsce-sign-alpine-x64" on the file system
npm error
npm error This can happen if you use the "--no-optional" flag. The "optionalDependencies"
npm error package.json feature is used to install the correct binary executable
npm error for your current platform. This install script will now attempt to work around
npm error this. If that fails, you need to remove the "--no-optional" flag to use @vscode/vsce-sign.
npm error
npm error [@vscode/vsce-sign] Trying to install package "@vscode/vsce-sign-alpine-x64" using npm
npm error [@vscode/vsce-sign] Failed to install package "@vscode/vsce-sign-alpine-x64" using npm: Command failed: npm install --loglevel=error --prefer-offline --no-audit --progress=false @vscode/vsce-sign-alpine-x64@2.0.2
npm error npm error code EBADPLATFORM
npm error npm error notsup Unsupported platform for @vscode/vsce-sign-alpine-x64@2.0.2: wanted {"os":"alpine","cpu":"x64"} (current: {"os":"linux","cpu":"x64"})
npm error npm error notsup Valid os:   alpine
npm error npm error notsup Actual os:  linux
npm error npm error notsup Valid cpu:  x64
npm error npm error notsup Actual cpu: x64
npm error npm error A complete log of this run can be found in: /root/.npm/_logs/2024-10-04T17_31_18_530Z-debug-0.log
npm error
npm error [@vscode/vsce-sign] Trying to download "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz"
npm error [@vscode/vsce-sign] Failed to download "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.2.tgz": AggregateError
npm error Failed to install package "@vscode/vsce-sign-alpine-x64"
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-10-04T17_31_14_528Z-debug-0.log

2024-10-04T17_31_14_528Z-debug-0.log

But if i add --os alpine, yes :

# npm install @vscode/vsce-sign --os alpine

added 2 packages in 4s