You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(node:54817) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @img/[email protected]: wanted {"os":"linux","cpu":"x64","libc":"glibc"} (current: {"os":"darwin","cpu":"arm64"})
npm error notsup Valid os: linux
npm error notsup Actual os: darwin
npm error notsup Valid cpu: x64
npm error notsup Actual cpu: arm64
npm error notsup Valid libc: glibc
npm error notsup Actual libc: undefined
npm error A complete log of this run can be found in: /Users/mgust/.npm/_logs/2024-11-12T12_58_40_495Z-debug-0.log
Environment
npm: 10.9.0
Node.js: 23.1.0
OS Name: MacOS
System Model Name: Macbook Pro
npm config:
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
i want to install sharp as lambda layer for a system with
an error occured
work around
npm install --os=linux --cpu=arm64 --libc=glibc --force (no opportunity to determine os and cpu)
Expected Behavior
for specified os and cpu:
Steps To Reproduce
package.json
{
"name": "sharp-layer",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"@img/sharp-libvips-linux-x64": "^1.0.4",
"@img/sharp-linux-x64": "^0.33.5",
"sharp": "^0.33.5"
}
}
/opt/homebrew/lib/node_modules/npm/node_modules/npm-install-checks/lib/index.js
...
const checkPlatform = (target, force = false, environment = {}) => {
if (force) {
return
}
const os = environment.os || currentEnv.os()
const cpu = environment.cpu || currentEnv.cpu()
const libc = environment.libc || currentEnv.libc(os)
const osOk = target.os ? checkList(os, target.os) : true
const cpuOk = target.cpu ? checkList(cpu, target.cpu) : true
let libcOk = target.libc ? checkList(libc, target.libc) : true
if (target.libc && !libc) {
libcOk = false
}
if (!osOk || !cpuOk || !libcOk) {
throw Object.assign(new Error('Unsupported platform'), {
pkgid: target._id,
current: {
os,
cpu,
libc,
},
required: {
os: target.os,
cpu: target.cpu,
libc: target.libc,
},
code: 'EBADPLATFORM',
})
}
}
...
npm install --os=linux --cpu=arm64 --libc=glibc
(node:54817) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use
node --trace-warnings ...
to show where the warning was created)npm error code EBADPLATFORM
npm error notsup Unsupported platform for @img/[email protected]: wanted {"os":"linux","cpu":"x64","libc":"glibc"} (current: {"os":"darwin","cpu":"arm64"})
npm error notsup Valid os: linux
npm error notsup Actual os: darwin
npm error notsup Valid cpu: x64
npm error notsup Actual cpu: arm64
npm error notsup Valid libc: glibc
npm error notsup Actual libc: undefined
npm error A complete log of this run can be found in: /Users/mgust/.npm/_logs/2024-11-12T12_58_40_495Z-debug-0.log
Environment
The text was updated successfully, but these errors were encountered: