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

Running sharp on platform linux/amd64 #3166

Closed
3 tasks done
simplenotezy opened this issue Mar 29, 2022 · 10 comments
Closed
3 tasks done

Running sharp on platform linux/amd64 #3166

simplenotezy opened this issue Mar 29, 2022 · 10 comments

Comments

@simplenotezy
Copy link

Problem.

When running sharp inside a docker image using FROM node:16-bullseye-slim it works as expected.

However, other parts of my application (e.g. the mongo-memory-server) requires me to do: FROM --platform=linux/amd64 node:16-bullseye-slim AS development - because I am on an M1 Arm machine.

When this platform is added, sharp no longer works, and fails with:

    nestjs-api-dev     | /usr/src/app/node_modules/sharp/lib/sharp.js:30
    nestjs-api-dev     |   throw new Error(help.join('\n'));
    nestjs-api-dev     |         ^
    nestjs-api-dev     | Error:
    nestjs-api-dev     | Something went wrong installing the "sharp" module
    nestjs-api-dev     |
    nestjs-api-dev     | Cannot find module '../build/Release/sharp-linuxmusl-x64.node'
    nestjs-api-dev     | Require stack:
    nestjs-api-dev     | - /usr/src/app/node_modules/sharp/lib/sharp.js
    nestjs-api-dev     | - /usr/src/app/node_modules/sharp/lib/constructor.js
    nestjs-api-dev     | - /usr/src/app/node_modules/sharp/lib/index.js
    nestjs-api-dev     | - /usr/src/app/dist/storage/service/storage.service.gcs.js
    nestjs-api-dev     | - /usr/src/app/dist/storage/service/storage.module.js
    nestjs-api-dev     | - /usr/src/app/dist/dating-profile/api/dating-profile.api.module.js
    nestjs-api-dev     | - /usr/src/app/dist/app.module.js
    nestjs-api-dev     | - /usr/src/app/dist/main.js
    nestjs-api-dev     |
    nestjs-api-dev     | Possible solutions:
    nestjs-api-dev     | - Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
    nestjs-api-dev     | - Install for the current runtime: "npm install --platform=linux --arch=x64 sharp"
    nestjs-api-dev     | - Consult the installation documentation: https://sharp.pixelplumbing.com/install
    nestjs-api-dev     |     at Object.<anonymous> (/usr/src/app/node_modules/sharp/lib/sharp.js:30:9)
    nestjs-api-dev     |     at Module._compile (node:internal/modules/cjs/loader:1103:14)
    nestjs-api-dev     |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    nestjs-api-dev     |     at Module.load (node:internal/modules/cjs/loader:981:32)
    nestjs-api-dev     |     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    nestjs-api-dev     |     at Module.require (node:internal/modules/cjs/loader:1005:19)
    nestjs-api-dev     |     at require (node:internal/modules/cjs/helpers:102:18)
    nestjs-api-dev     |     at Object.<anonymous> (/usr/src/app/node_modules/sharp/lib/constructor.js:8:1)
    nestjs-api-dev     |     at Module._compile (node:internal/modules/cjs/loader:1103:14)
    nestjs-api-dev     |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)

I notice it's trying to look for ../build/Release/sharp-linux-arm64v8.node however, the only release file that's inside that folder is: sharp-linuxmusl-arm64v8.node

Possible install-time or require-time problem

  • I have read the documentation relating to installation.
  • I have ensured that the architecture and platform of Node.js used for npm install is the same as the architecture and platform of Node.js used at runtime.

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

What is the complete output of running npm install --verbose sharp?

npm verb cli [ npm verb cli '/usr/local/bin/node', npm verb cli '/usr/local/bin/npm', npm verb cli 'install', npm verb cli '--verbose', npm verb cli 'sharp' npm verb cli ] npm info using npm@8.5.0 npm info using node@v16.14.2 npm timing npm:load:whichnode Completed in 2ms npm timing config:load:defaults Completed in 9ms npm timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 25ms npm timing config:load:builtin Completed in 27ms npm timing config:load:cli Completed in 17ms npm timing config:load:env Completed in 2ms npm timing config:load:file:/usr/src/app/.npmrc Completed in 2ms npm timing config:load:project Completed in 38ms npm timing config:load:file:/root/.npmrc Completed in 0ms npm timing config:load:user Completed in 1ms npm timing config:load:file:/usr/local/etc/npmrc Completed in 1ms npm timing config:load:global Completed in 1ms npm timing config:load:validate Completed in 1ms npm timing config:load:credentials Completed in 11ms npm timing config:load:setEnvs Completed in 8ms npm timing config:load Completed in 128ms npm timing npm:load:configload Completed in 131ms npm timing npm:load:setTitle Completed in 2ms npm timing config:load:flatten Completed in 17ms npm timing npm:load:display Completed in 56ms npm verb logfile /root/.npm/_logs/2022-03-29T21_01_17_968Z-debug-0.log npm timing npm:load:logFile Completed in 46ms npm timing npm:load:timers Completed in 0ms npm timing npm:load:configScope Completed in 0ms npm timing npm:load Completed in 250ms npm timing arborist:ctor Completed in 3ms npm timing idealTree:init Completed in 5460ms npm timing idealTree:userRequests Completed in 68ms npm timing arborist:ctor Completed in 2ms npm http fetch GET 200 https://registry.npmjs.org/sharp 3892ms (cache hit) npm timing idealTree:#root Completed in 4011ms npm timing idealTree:node_modules/sharp Completed in 0ms npm timing idealTree:buildDeps Completed in 4025ms npm timing idealTree:fixDepFlags Completed in 72ms npm timing idealTree Completed in 9731ms npm timing reify:loadTrees Completed in 9736ms npm timing reify:diffTrees Completed in 147ms npm timing reify:retireShallow Completed in 2ms npm timing reify:createSparse Completed in 13ms npm timing reify:loadBundles Completed in 0ms npm verb reify failed optional dependency /usr/src/app/node_modules/fsevents npm timing reifyNode:node_modules/fsevents Completed in 144ms npm timing reify:unpack Completed in 147ms npm timing reify:unretire Completed in 0ms npm timing build:queue Completed in 23ms npm timing build:deps Completed in 26ms npm timing build Completed in 28ms npm timing reify:build Completed in 31ms npm timing reify:trash Completed in 17ms npm timing reify:save Completed in 1299ms npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 2167ms npm timing auditReport:getReport Completed in 2281ms npm timing metavuln:cache:get:security-advisory:lodash:BY7sQC4AL0WtNZxlRDc7Fwtia3UmorZ+admMokN1sG9nmIuwJ0b/7Zp8vmUE4ZzN2sEm+EyGDB/Q8SemsUZaNQ== Completed in 162ms npm timing metavuln:cache:get:security-advisory:lodash:NGsVU5oTv3c3z8cJMlM8Y7wONhepslJJfeg1yFtmEwRoLrJc7Ov+MQ4+MG173NJ5HshEGuW1+Qti6QqVwdnnXA== Completed in 167ms npm timing metavuln:cache:get:security-advisory:engine.io:fPAq4W48obFkfzpr20aD16SeSfXY9rb+6rxU4LTQqXJuwsE5i0WF9peZn+D1WRrAvrkdvU/7u6RPm5ehI//OLQ== Completed in 179ms npm timing metavuln:cache:get:security-advisory:lodash:EHY4V/H/HR9ntfq+UHsdp3t/ClHEwFAEQZl/w1R/d07NFv83Ryjed9Y0+GPRWx4VHzVVZbNyeVKL1Tq41WJZYQ== Completed in 168ms npm timing metavuln:cache:get:security-advisory:lodash:DSZy3/njmAVukKNuBXvve14Hnimjy5nv4CfXOxVGW+/iM6v38MJFGcxUCq5XS084gttFuVThMAAnwYT/WN4arw== Completed in 170ms npm timing metavuln:cache:get:security-advisory:lodash:3IpO8pMSzwx1xLEcmkZXEocgKnhT+V6+Z1itQrjzML//u8Yion/vnxlDk7Q2y/0aRrqUhA/16HvAACMr51YIJA== Completed in 170ms npm timing metavuln:cache:get:security-advisory:lodash:ke8YepJ8/N56Nx+Zo06YLnC0SnoDH0Rj/l47WHj3j3biNaCIh/q1nWaowj0EOcdGNsy9JV5pkg66HA+FUdtywg== Completed in 172ms npm timing metavuln:cache:get:security-advisory:minimist:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 171ms npm timing metavuln:cache:get:security-advisory:node-forge:cd03itj1xNgaqpZlkM3DSYPBZqfVQBqg44ISfvIYeU1zQDpte4SZ1r6T3JMM6GRDWqzyc1vACvbqkfYaPRXelQ== Completed in 169ms npm timing metavuln:cache:get:security-advisory:lodash:Z9y/gpkO9ApfyfjRVooh8gLbB6tkyaXKVqpAKgJnkzcl3YkF/OVVVNm3c2ZcjHH0RRLx7wBV6eF6u2MMBdKVtQ== Completed in 175ms npm timing metavuln:cache:get:security-advisory:node-forge:FA5dVSxjV2PzTiEW5FspsgiErmOSHez3tbThqjAtyGJFkDx6iePwtToZQW6LsXtaCCGyrNjC1YUYx/WPA2VhAw== Completed in 174ms npm timing metavuln:cache:get:security-advisory:node-forge:eTHlzDL+UVScP3jm/mW+/tHb/N7RDPfRKPKM+bTWr2hfRIP7VvxvFKUx+aYnarAiHwkYDfsiYEYgA6XM7SR+Ow== Completed in 174ms npm timing metavuln:cache:get:security-advisory:node-forge:fgkHr1/pLsSxbKy+ZrvUQoJdWrHE+TGRTZhckm71MqpUolSHhAIPsBpVAs/dry5zgH8hNxsggkvzMFDCGEso+g== Completed in 172ms npm timing metavuln:cache:get:security-advisory:node-forge:/J23yVVnHocPY63nMCTG43sKfRGSZeMywIUOeqWbgY3bmA3l3TrHCyPAF7GBh4p4s/I9pcTa/jWBD+gqkvxkdg== Completed in 175ms npm timing metavuln:cache:get:security-advisory:node-forge:32NPCKXuswhh0N2Pvtge2s5wzJ4fwlE5pVfjV/Wq+cKw4BnTo+HUyBrWGpurK8KSm6hQqxy947h2ADshCkaQXw== Completed in 174ms npm timing metavuln:cache:get:security-advisory:nodemailer:s9EYy6JQ5n2HgfSnWlFVkCgvme+nV02W7ujQ0O2RSAK27LERWx3p4UXCXuH3bepwhrHGZH+X1g/bRzcM55jDhA== Completed in 176ms npm timing metavuln:cache:get:security-advisory:nodemailer:6xPMZ+clUdnDdUAOebr7CQlpOrBYszBxOrkgDnSgo0Tz23RhExJvuM5Q6UxyMsz9qMtbNWHae4AftlXkZqTekg== Completed in 175ms npm timing metavuln:cache:get:security-advisory:nth-check:l8x6X5MVdszgSgKu+BUvYrW1sr4jcO5UZnU+BqjhlXopI/lRfP8c/FRUC+Nuayf+mTM6kEMvnxieQLFtR5W9DQ== Completed in 177ms npm timing metavuln:cache:get:security-advisory:socket.io:gh3OeYBQOSYbZmj6C3hatIpekU1PLZOq6fwqmR+L/4foor14PfXqplK1BbKICVHj1ltjAM3097WoEGLE308+mA== Completed in 177ms npm timing metavuln:cache:get:security-advisory:ws:Ol41P8/MGnQCv8uwe8FX9cZIWgyuZ60yOI4XUIKyKvD77LsBv3qWDOq/CqWVuMHyOlAcsFz41vzVkS7voet+cQ== Completed in 175ms npm http fetch GET 200 https://registry.npmjs.org/lodash 293ms (cache hit) npm timing metavuln:packument:lodash Completed in 355ms npm timing metavuln:load:security-advisory:lodash:1067224 Completed in 53ms npm timing metavuln:calculate:security-advisory:lodash:1067224 Completed in 419ms npm timing metavuln:load:security-advisory:lodash:1065345 Completed in 7ms npm timing metavuln:calculate:security-advisory:lodash:1065345 Completed in 426ms npm timing metavuln:load:security-advisory:lodash:1065397 Completed in 58ms npm timing metavuln:calculate:security-advisory:lodash:1065397 Completed in 485ms npm timing metavuln:load:security-advisory:lodash:1066702 Completed in 4ms npm timing metavuln:calculate:security-advisory:lodash:1066702 Completed in 490ms npm timing metavuln:load:security-advisory:lodash:1066769 Completed in 19ms npm timing metavuln:calculate:security-advisory:lodash:1066769 Completed in 519ms npm timing metavuln:load:security-advisory:lodash:1066949 Completed in 5ms npm timing metavuln:calculate:security-advisory:lodash:1066949 Completed in 524ms npm timing metavuln:load:security-advisory:lodash:1066994 Completed in 4ms npm timing metavuln:calculate:security-advisory:lodash:1066994 Completed in 528ms npm http fetch GET 200 https://registry.npmjs.org/engine.io 596ms (cache hit) npm timing metavuln:packument:engine.io Completed in 644ms npm timing metavuln:load:security-advisory:engine.io:1065331 Completed in 8ms npm timing metavuln:calculate:security-advisory:engine.io:1065331 Completed in 662ms npm http fetch GET 200 https://registry.npmjs.org/nth-check 638ms (cache hit) npm timing metavuln:packument:nth-check Completed in 644ms npm timing metavuln:load:security-advisory:nth-check:1064864 Completed in 7ms npm timing metavuln:calculate:security-advisory:nth-check:1064864 Completed in 654ms npm http fetch GET 200 https://registry.npmjs.org/nodemailer 668ms (cache hit) npm timing metavuln:packument:nodemailer Completed in 690ms npm timing metavuln:load:security-advisory:nodemailer:1065020 Completed in 25ms npm timing metavuln:calculate:security-advisory:nodemailer:1065020 Completed in 719ms npm timing metavuln:load:security-advisory:nodemailer:1065274 Completed in 22ms npm timing metavuln:calculate:security-advisory:nodemailer:1065274 Completed in 741ms npm http fetch GET 200 https://registry.npmjs.org/socket.io 757ms (cache hit) npm timing metavuln:packument:socket.io Completed in 765ms npm timing metavuln:load:security-advisory:socket.io:1065478 Completed in 4ms npm timing metavuln:calculate:security-advisory:socket.io:1065478 Completed in 770ms npm http fetch GET 200 https://registry.npmjs.org/minimist 782ms (cache hit) npm timing metavuln:packument:minimist Completed in 785ms npm timing metavuln:load:security-advisory:minimist:1067285 Completed in 0ms npm timing metavuln:calculate:security-advisory:minimist:1067285 Completed in 789ms npm http fetch GET 200 https://registry.npmjs.org/ws 773ms (cache hit) npm timing metavuln:packument:ws Completed in 781ms npm timing metavuln:load:security-advisory:ws:1065064 Completed in 3ms npm timing metavuln:calculate:security-advisory:ws:1065064 Completed in 788ms npm http fetch GET 200 https://registry.npmjs.org/node-forge 800ms (cache hit) npm timing metavuln:packument:node-forge Completed in 805ms npm timing metavuln:load:security-advisory:node-forge:1067280 Completed in 3ms npm timing metavuln:calculate:security-advisory:node-forge:1067280 Completed in 811ms npm timing metavuln:load:security-advisory:node-forge:1067279 Completed in 3ms npm timing metavuln:calculate:security-advisory:node-forge:1067279 Completed in 812ms npm timing metavuln:load:security-advisory:node-forge:1067278 Completed in 2ms npm timing metavuln:calculate:security-advisory:node-forge:1067278 Completed in 814ms npm timing metavuln:load:security-advisory:node-forge:1064657 Completed in 2ms npm timing metavuln:calculate:security-advisory:node-forge:1064657 Completed in 816ms npm timing metavuln:load:security-advisory:node-forge:1064676 Completed in 3ms npm timing metavuln:calculate:security-advisory:node-forge:1064676 Completed in 818ms npm timing metavuln:load:security-advisory:node-forge:1064678 Completed in 3ms npm timing metavuln:calculate:security-advisory:node-forge:1064678 Completed in 820ms npm timing metavuln:cache:get:security-advisory:socket.io:6eIcFHoCVegK5TNM4YsthNE1iWdOoDOxUq9MHhgebsJw5ZeKa3zPH/4e26lq7VnKeGFntDfMhSQUacuwpQHScQ== Completed in 43ms npm timing metavuln:load:security-advisory:socket.io:fPAq4W48obFkfzpr20aD16SeSfXY9rb+6rxU4LTQqXJuwsE5i0WF9peZn+D1WRrAvrkdvU/7u6RPm5ehI//OLQ== Completed in 2ms npm timing metavuln:calculate:security-advisory:socket.io:fPAq4W48obFkfzpr20aD16SeSfXY9rb+6rxU4LTQqXJuwsE5i0WF9peZn+D1WRrAvrkdvU/7u6RPm5ehI//OLQ== Completed in 50ms npm timing metavuln:cache:get:security-advisory:cheerio:E0mMVbXnbzGGyl1NnZrFstI6HquxCUc7CKvIiu5jcmL0fAH0xMQEumy0m36Yz6THIjNOEjlVlKOe+5/0oN7pFg== Completed in 56ms npm http fetch GET 200 https://registry.npmjs.org/cheerio 76ms (cache hit) npm timing metavuln:packument:cheerio Completed in 94ms npm timing metavuln:load:security-advisory:cheerio:BY7sQC4AL0WtNZxlRDc7Fwtia3UmorZ+admMokN1sG9nmIuwJ0b/7Zp8vmUE4ZzN2sEm+EyGDB/Q8SemsUZaNQ== Completed in 2ms npm timing metavuln:calculate:security-advisory:cheerio:BY7sQC4AL0WtNZxlRDc7Fwtia3UmorZ+admMokN1sG9nmIuwJ0b/7Zp8vmUE4ZzN2sEm+EyGDB/Q8SemsUZaNQ== Completed in 100ms npm timing metavuln:cache:get:security-advisory:@angular-devkit/schematics-cli:TRfUrwGgUD0f1zlj00RmyjGOGaI6O0VQgruhNyoeKJCPaNJWZCdVSPIxL8G56w/yBFCxVhOkgfPhoOAIp7gYbQ== Completed in 71ms npm timing metavuln:cache:get:security-advisory:json5:LvW6V3zqjjNw8DI5qWtY3hia5a5P22nLD0LTNdvyi9ejGpqq6/Asphu8rB7YaK6Viatycdmx5vAWGwbO8OdfrQ== Completed in 59ms npm timing metavuln:cache:get:security-advisory:tsconfig-paths:hJh+jsBnPHtTzxk0FOpTF3UrmBbgNVB/XWrS1epRvqYQsYq2evuPN7lFvDskmpoVwiwAh3HhOG0QvK1zlv9lQQ== Completed in 53ms npm timing metavuln:cache:get:security-advisory:handlebars:5fyusFYRKTJu/MyLIngu3LmyefC5b6yz+9K88n9NkL3kQi/Juy44AQFhptEckMxL8pCezLWYpErAZZbLugsb2A== Completed in 53ms npm timing metavuln:cache:get:security-advisory:html-to-text:EJCZr0H/A9wF7HsJVg5cn04AuA6xfyX6u3E9NxvbBQY43cHr9xQQdEEmEB2+e6HRCI0p7/dHYf0ahCAWX21BIA== Completed in 52ms npm timing metavuln:cache:get:security-advisory:make-plural:2X259epR/yhdD26gUwI58GO9B5MnQT04hpg+LKpWQUsOB92X6G2JiFXIDVOAxqO+EVKrfDFUy+jBkj1j91NdVg== Completed in 52ms npm timing metavuln:cache:get:security-advisory:prebuild-install:GBFNEnRvciDSjcYuL/WLyTZVVmesuhJWqVaWhLLO2B+vZqb6DHFiKD09lOoafmSglbvZwDheXkYmh59TTSnBKA== Completed in 53ms npm timing metavuln:cache:get:security-advisory:rc:CVhJr6+3hZhWEEyAUWE69ahZo9junQJjsxgF7C5r9tUkvgucjCB/37UZwfYzzuLxhNItDmS2zh42wMICWQSYTw== Completed in 53ms npm http fetch GET 200 https://registry.npmjs.org/json5 104ms (cache hit) npm timing metavuln:packument:json5 Completed in 112ms npm timing metavuln:load:security-advisory:json5:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 1ms npm timing metavuln:calculate:security-advisory:json5:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 115ms npm http fetch GET 200 https://registry.npmjs.org/tsconfig-paths 118ms (cache hit) npm timing metavuln:packument:tsconfig-paths Completed in 123ms npm timing metavuln:load:security-advisory:tsconfig-paths:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 0ms npm timing metavuln:calculate:security-advisory:tsconfig-paths:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 126ms npm http fetch GET 200 https://registry.npmjs.org/rc 119ms (cache hit) npm timing metavuln:packument:rc Completed in 122ms npm timing metavuln:load:security-advisory:rc:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 1ms npm timing metavuln:calculate:security-advisory:rc:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 126ms npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 127ms (cache hit) npm timing metavuln:packument:prebuild-install Completed in 132ms npm timing metavuln:load:security-advisory:prebuild-install:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 1ms npm timing metavuln:calculate:security-advisory:prebuild-install:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 134ms npm http fetch GET 200 https://registry.npmjs.org/make-plural 138ms (cache hit) npm timing metavuln:packument:make-plural Completed in 143ms npm timing metavuln:load:security-advisory:make-plural:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 1ms npm timing metavuln:calculate:security-advisory:make-plural:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 144ms npm http fetch GET 200 https://registry.npmjs.org/html-to-text 148ms (cache hit) npm timing metavuln:packument:html-to-text Completed in 152ms npm timing metavuln:load:security-advisory:html-to-text:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 1ms npm timing metavuln:calculate:security-advisory:html-to-text:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 153ms npm http fetch GET 200 https://registry.npmjs.org/handlebars 157ms (cache hit) npm timing metavuln:packument:handlebars Completed in 166ms npm timing metavuln:load:security-advisory:handlebars:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 7ms npm timing metavuln:calculate:security-advisory:handlebars:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 175ms npm http fetch GET 200 https://registry.npmjs.org/@angular-devkit%2fschematics-cli 190ms (cache hit) npm timing metavuln:packument:@angular-devkit/schematics-cli Completed in 219ms npm timing metavuln:load:security-advisory:@angular-devkit/schematics-cli:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 26ms npm timing metavuln:calculate:security-advisory:@angular-devkit/schematics-cli:NONASLfTlNcgULjH53Tn+JdSwkDfAcT56bpR8UbPKBiojsS1f+8i1JfsZ7SBgAmGH7JMe21CAsGgVFqGoNwK3Q== Completed in 249ms npm timing metavuln:cache:get:security-advisory:firebase-admin:TiZg7eaHfC4s2iUbvQVxtiipXdvEL4PHD/qLVJS8wiGo6grPLGsBzAQKnHiUVM1hqxR8oNcgmfRebQsSvNo/YQ== Completed in 16ms npm http fetch GET 200 https://registry.npmjs.org/firebase-admin 26ms (cache hit) npm timing metavuln:packument:firebase-admin Completed in 42ms npm timing metavuln:load:security-advisory:firebase-admin:cd03itj1xNgaqpZlkM3DSYPBZqfVQBqg44ISfvIYeU1zQDpte4SZ1r6T3JMM6GRDWqzyc1vACvbqkfYaPRXelQ== Completed in 3ms npm timing metavuln:calculate:security-advisory:firebase-admin:cd03itj1xNgaqpZlkM3DSYPBZqfVQBqg44ISfvIYeU1zQDpte4SZ1r6T3JMM6GRDWqzyc1vACvbqkfYaPRXelQ== Completed in 48ms npm timing metavuln:cache:get:security-advisory:smtp-server:4pnWSr4Kwkr1o0/BVkHJfytYXq2DOdH1GbmCqKPSurIT+BPiMlFVLfen4VqcTBtua02A/6DAd7U5OtvUeYkNAg== Completed in 19ms npm timing metavuln:cache:get:security-advisory:smtp-connection:rMLHVzrrAio2WUJx7Drt2kY1L4ouQiAQDtlnHZ7k74K7N5o/zd0a4453Sj46TD86xNRmzi8knwQlxd9R3MxpOQ== Completed in 25ms npm http fetch GET 200 https://registry.npmjs.org/smtp-server 40ms (cache hit) npm timing metavuln:packument:smtp-server Completed in 46ms npm timing metavuln:load:security-advisory:smtp-server:s9EYy6JQ5n2HgfSnWlFVkCgvme+nV02W7ujQ0O2RSAK27LERWx3p4UXCXuH3bepwhrHGZH+X1g/bRzcM55jDhA== Completed in 1ms npm timing metavuln:calculate:security-advisory:smtp-server:s9EYy6JQ5n2HgfSnWlFVkCgvme+nV02W7ujQ0O2RSAK27LERWx3p4UXCXuH3bepwhrHGZH+X1g/bRzcM55jDhA== Completed in 51ms npm http fetch GET 200 https://registry.npmjs.org/smtp-connection 56ms (cache hit) npm timing metavuln:packument:smtp-connection Completed in 61ms npm timing metavuln:load:security-advisory:smtp-connection:s9EYy6JQ5n2HgfSnWlFVkCgvme+nV02W7ujQ0O2RSAK27LERWx3p4UXCXuH3bepwhrHGZH+X1g/bRzcM55jDhA== Completed in 1ms npm timing metavuln:calculate:security-advisory:smtp-connection:s9EYy6JQ5n2HgfSnWlFVkCgvme+nV02W7ujQ0O2RSAK27LERWx3p4UXCXuH3bepwhrHGZH+X1g/bRzcM55jDhA== Completed in 65ms npm timing metavuln:cache:get:security-advisory:css-select:UtMfoLn1qKqtdLD3zmMnp18aISN/AJarB2IRdJP0O9jZfAPPi3n5/wSwcH3bgTtqKdsHOqIifyf2cRYuX4WoJw== Completed in 18ms npm http fetch GET 200 https://registry.npmjs.org/css-select 43ms (cache hit) npm timing metavuln:packument:css-select Completed in 54ms npm timing metavuln:load:security-advisory:css-select:l8x6X5MVdszgSgKu+BUvYrW1sr4jcO5UZnU+BqjhlXopI/lRfP8c/FRUC+Nuayf+mTM6kEMvnxieQLFtR5W9DQ== Completed in 2ms npm timing metavuln:calculate:security-advisory:css-select:l8x6X5MVdszgSgKu+BUvYrW1sr4jcO5UZnU+BqjhlXopI/lRfP8c/FRUC+Nuayf+mTM6kEMvnxieQLFtR5W9DQ== Completed in 61ms npm timing metavuln:cache:get:security-advisory:maildev:N1yIbtHBBuN/WaZa9EdzTEXVG3dv88NoRypmCQ8/ZKZPoaFSCTKzSiHusjTbMCjE/Rka8jfUP237/egucK4jkw== Completed in 17ms npm http fetch GET 200 https://registry.npmjs.org/maildev 39ms (cache hit) npm timing metavuln:packument:maildev Completed in 47ms npm timing metavuln:load:security-advisory:maildev:gh3OeYBQOSYbZmj6C3hatIpekU1PLZOq6fwqmR+L/4foor14PfXqplK1BbKICVHj1ltjAM3097WoEGLE308+mA== Completed in 1ms npm timing metavuln:calculate:security-advisory:maildev:gh3OeYBQOSYbZmj6C3hatIpekU1PLZOq6fwqmR+L/4foor14PfXqplK1BbKICVHj1ltjAM3097WoEGLE308+mA== Completed in 52ms npm timing metavuln:cache:get:security-advisory:engine.io:LFd+Zv6CqpwDyj/E6/FvO7BjVzMQXtCSH/8kffaSvKpYgcyqUZjwiAiWO0168q3UzEYRR4oz+0L24sDkXZhlVA== Completed in 11ms npm timing metavuln:load:security-advisory:engine.io:Ol41P8/MGnQCv8uwe8FX9cZIWgyuZ60yOI4XUIKyKvD77LsBv3qWDOq/CqWVuMHyOlAcsFz41vzVkS7voet+cQ== Completed in 2ms npm timing metavuln:calculate:security-advisory:engine.io:Ol41P8/MGnQCv8uwe8FX9cZIWgyuZ60yOI4XUIKyKvD77LsBv3qWDOq/CqWVuMHyOlAcsFz41vzVkS7voet+cQ== Completed in 15ms npm timing metavuln:cache:get:security-advisory:engine.io-client:ouiEZ0Qw1vD3QYlZJjsPiR/zjXlJK/Yi+1UFfdoGK5brqu9LqjA0VQv8pvIF73iNC8R8e7aH4yd69xjLGvZDfw== Completed in 21ms npm http fetch GET 200 https://registry.npmjs.org/engine.io-client 28ms (cache hit) npm timing metavuln:packument:engine.io-client Completed in 39ms npm timing metavuln:load:security-advisory:engine.io-client:Ol41P8/MGnQCv8uwe8FX9cZIWgyuZ60yOI4XUIKyKvD77LsBv3qWDOq/CqWVuMHyOlAcsFz41vzVkS7voet+cQ== Completed in 2ms npm timing metavuln:calculate:security-advisory:engine.io-client:Ol41P8/MGnQCv8uwe8FX9cZIWgyuZ60yOI4XUIKyKvD77LsBv3qWDOq/CqWVuMHyOlAcsFz41vzVkS7voet+cQ== Completed in 44ms npm timing metavuln:cache:get:security-advisory:strip-tags:kw1fP50NFsvfkjzXHOPvN5WNZP9UuMqtfVoFPIJRJiMQPUdAi4Ma4Qn8IIF9gyu66/WEFm4ZnKUuXSTG55z2vw== Completed in 9ms npm http fetch GET 200 https://registry.npmjs.org/strip-tags 19ms (cache hit) npm timing metavuln:packument:strip-tags Completed in 24ms npm timing metavuln:load:security-advisory:strip-tags:E0mMVbXnbzGGyl1NnZrFstI6HquxCUc7CKvIiu5jcmL0fAH0xMQEumy0m36Yz6THIjNOEjlVlKOe+5/0oN7pFg== Completed in 0ms npm timing metavuln:calculate:security-advisory:strip-tags:E0mMVbXnbzGGyl1NnZrFstI6HquxCUc7CKvIiu5jcmL0fAH0xMQEumy0m36Yz6THIjNOEjlVlKOe+5/0oN7pFg== Completed in 27ms npm timing metavuln:cache:get:security-advisory:@nestjs/cli:0IVlfsW7acHRbGGPebxv0NfpeAOJ4SkeoNZP+DVdCwzW/gqntHunptwr22OZcS9RS+Y8ujB8brIsEFXrmkoKMw== Completed in 15ms npm http fetch GET 200 https://registry.npmjs.org/@nestjs%2fcli 25ms (cache hit) npm timing metavuln:packument:@nestjs/cli Completed in 45ms npm timing metavuln:load:security-advisory:@nestjs/cli:TRfUrwGgUD0f1zlj00RmyjGOGaI6O0VQgruhNyoeKJCPaNJWZCdVSPIxL8G56w/yBFCxVhOkgfPhoOAIp7gYbQ== Completed in 4ms npm timing metavuln:calculate:security-advisory:@nestjs/cli:TRfUrwGgUD0f1zlj00RmyjGOGaI6O0VQgruhNyoeKJCPaNJWZCdVSPIxL8G56w/yBFCxVhOkgfPhoOAIp7gYbQ== Completed in 51ms npm timing metavuln:cache:get:security-advisory:maildev:PXxM111vCxJi1lxlDvgdKItE5P/lv7QXtLfypyGAgnEL56EpVO/mqdMTdtuS8nL6LnpmRpYmDFaBaqzC1fkniQ== Completed in 12ms npm timing metavuln:load:security-advisory:maildev:4pnWSr4Kwkr1o0/BVkHJfytYXq2DOdH1GbmCqKPSurIT+BPiMlFVLfen4VqcTBtua02A/6DAd7U5OtvUeYkNAg== Completed in 2ms npm timing metavuln:calculate:security-advisory:maildev:4pnWSr4Kwkr1o0/BVkHJfytYXq2DOdH1GbmCqKPSurIT+BPiMlFVLfen4VqcTBtua02A/6DAd7U5OtvUeYkNAg== Completed in 16ms npm timing metavuln:cache:get:security-advisory:maildev:PTwwfeXcFSfTKuYKAAC3bsBMp6FY7g4XI++SrkGfQWbfMGLmCRP4aHtw1vqSM1XP3YtrALgNLOGaUxMJ0awKkg== Completed in 2ms npm timing metavuln:load:security-advisory:maildev:rMLHVzrrAio2WUJx7Drt2kY1L4ouQiAQDtlnHZ7k74K7N5o/zd0a4453Sj46TD86xNRmzi8knwQlxd9R3MxpOQ== Completed in 1ms npm timing metavuln:calculate:security-advisory:maildev:rMLHVzrrAio2WUJx7Drt2kY1L4ouQiAQDtlnHZ7k74K7N5o/zd0a4453Sj46TD86xNRmzi8knwQlxd9R3MxpOQ== Completed in 5ms npm timing metavuln:cache:get:security-advisory:cheerio:/xMnpR3gAXCLP3GEW01WGhsFVRioImymTC5eu0TymR2CMMfsfZyK2JXfsjNZDXjjket62gbUeP4zFw3KqRl9UA== Completed in 3ms npm timing metavuln:load:security-advisory:cheerio:UtMfoLn1qKqtdLD3zmMnp18aISN/AJarB2IRdJP0O9jZfAPPi3n5/wSwcH3bgTtqKdsHOqIifyf2cRYuX4WoJw== Completed in 2ms npm timing metavuln:calculate:security-advisory:cheerio:UtMfoLn1qKqtdLD3zmMnp18aISN/AJarB2IRdJP0O9jZfAPPi3n5/wSwcH3bgTtqKdsHOqIifyf2cRYuX4WoJw== Completed in 7ms npm timing metavuln:cache:get:security-advisory:socket.io-client:/P1HMRy6O+dVdWHzx1bqmn62nBo1+VrSDMOpBq2h9ARfxZD06om9mjd1lb3wCE5uW78qiSTJeofgm5fb1EeqvQ== Completed in 30ms npm http fetch GET 200 https://registry.npmjs.org/socket.io-client 46ms (cache hit) npm timing metavuln:packument:socket.io-client Completed in 59ms npm timing metavuln:load:security-advisory:socket.io-client:ouiEZ0Qw1vD3QYlZJjsPiR/zjXlJK/Yi+1UFfdoGK5brqu9LqjA0VQv8pvIF73iNC8R8e7aH4yd69xjLGvZDfw== Completed in 2ms npm timing metavuln:calculate:security-advisory:socket.io-client:ouiEZ0Qw1vD3QYlZJjsPiR/zjXlJK/Yi+1UFfdoGK5brqu9LqjA0VQv8pvIF73iNC8R8e7aH4yd69xjLGvZDfw== Completed in 63ms npm timing metavuln:cache:get:security-advisory:maildev:dB9PDzLi0RcTYRelcd8H7UUhsKgQwroLJyJvOwmFqg9H0PR+L9wNyS1zSKrZlepGsxbmlKd/UWf9m6wsppJ/aQ== Completed in 6ms npm timing metavuln:load:security-advisory:maildev:kw1fP50NFsvfkjzXHOPvN5WNZP9UuMqtfVoFPIJRJiMQPUdAi4Ma4Qn8IIF9gyu66/WEFm4ZnKUuXSTG55z2vw== Completed in 0ms npm timing metavuln:calculate:security-advisory:maildev:kw1fP50NFsvfkjzXHOPvN5WNZP9UuMqtfVoFPIJRJiMQPUdAi4Ma4Qn8IIF9gyu66/WEFm4ZnKUuXSTG55z2vw== Completed in 8ms npm timing metavuln:cache:get:security-advisory:list-stylesheets:4c1ailpvRUItQsYML6L7TNbUFAAni5Iuc+02yzAOs2i/t4acl+QxR906Oix4foqmwpkzVqqlkhXT02mmEzMEqg== Completed in 31ms npm timing metavuln:cache:get:security-advisory:inline-css:eS3ZV6kykz82WgzBZI93vBhpzXVTpBDXJ9L5giv/JEj2mDHuJh/W1uwIs7BJjIEU1HntVXr6OEpvMP2rHQeUig== Completed in 43ms npm timing metavuln:cache:get:security-advisory:style-data:AAY/vUQaqAP5EpvSIe9gOqIDtCFFftGz3nwCByUUsosTgMuKmOn6mADH+i3uYGVZryHSCgXixI4W2Gp0kyFtiA== Completed in 29ms npm http fetch GET 200 https://registry.npmjs.org/inline-css 61ms (cache hit) npm timing metavuln:packument:inline-css Completed in 71ms npm timing metavuln:load:security-advisory:inline-css:/xMnpR3gAXCLP3GEW01WGhsFVRioImymTC5eu0TymR2CMMfsfZyK2JXfsjNZDXjjket62gbUeP4zFw3KqRl9UA== Completed in 2ms npm timing metavuln:calculate:security-advisory:inline-css:/xMnpR3gAXCLP3GEW01WGhsFVRioImymTC5eu0TymR2CMMfsfZyK2JXfsjNZDXjjket62gbUeP4zFw3KqRl9UA== Completed in 78ms npm http fetch GET 200 https://registry.npmjs.org/list-stylesheets 67ms (cache hit) npm timing metavuln:packument:list-stylesheets Completed in 73ms npm timing metavuln:load:security-advisory:list-stylesheets:/xMnpR3gAXCLP3GEW01WGhsFVRioImymTC5eu0TymR2CMMfsfZyK2JXfsjNZDXjjket62gbUeP4zFw3KqRl9UA== Completed in 1ms npm timing metavuln:calculate:security-advisory:list-stylesheets:/xMnpR3gAXCLP3GEW01WGhsFVRioImymTC5eu0TymR2CMMfsfZyK2JXfsjNZDXjjket62gbUeP4zFw3KqRl9UA== Completed in 75ms npm http fetch GET 200 https://registry.npmjs.org/style-data 69ms (cache hit) npm timing metavuln:packument:style-data Completed in 74ms npm timing metavuln:load:security-advisory:style-data:/xMnpR3gAXCLP3GEW01WGhsFVRioImymTC5eu0TymR2CMMfsfZyK2JXfsjNZDXjjket62gbUeP4zFw3KqRl9UA== Completed in 1ms npm timing metavuln:calculate:security-advisory:style-data:/xMnpR3gAXCLP3GEW01WGhsFVRioImymTC5eu0TymR2CMMfsfZyK2JXfsjNZDXjjket62gbUeP4zFw3KqRl9UA== Completed in 77ms npm timing metavuln:cache:get:security-advisory:socket.io:d82S2H4oLk8nvUetivbluurWtytSwKVjrpUZeAuNeNGzz2gufiT20p613U2RZWWs2EV0xS5lJHUct8OdXYukwQ== Completed in 4ms npm timing metavuln:load:security-advisory:socket.io:/P1HMRy6O+dVdWHzx1bqmn62nBo1+VrSDMOpBq2h9ARfxZD06om9mjd1lb3wCE5uW78qiSTJeofgm5fb1EeqvQ== Completed in 2ms npm timing metavuln:calculate:security-advisory:socket.io:/P1HMRy6O+dVdWHzx1bqmn62nBo1+VrSDMOpBq2h9ARfxZD06om9mjd1lb3wCE5uW78qiSTJeofgm5fb1EeqvQ== Completed in 7ms npm timing metavuln:cache:get:security-advisory:@nestjs-modules/mailer:g9SL6MCaOCueyAX6rRoBrnOqZGNCkXkDo3I+I54t49XIUujMj/PmYr7xP7j3iPZA8ATzXQlBWBnUjCqnmQPRag== Completed in 12ms npm http fetch GET 200 https://registry.npmjs.org/@nestjs-modules%2fmailer 25ms (cache hit) npm timing metavuln:packument:@nestjs-modules/mailer Completed in 33ms npm timing metavuln:load:security-advisory:@nestjs-modules/mailer:eS3ZV6kykz82WgzBZI93vBhpzXVTpBDXJ9L5giv/JEj2mDHuJh/W1uwIs7BJjIEU1HntVXr6OEpvMP2rHQeUig== Completed in 1ms npm timing metavuln:calculate:security-advisory:@nestjs-modules/mailer:eS3ZV6kykz82WgzBZI93vBhpzXVTpBDXJ9L5giv/JEj2mDHuJh/W1uwIs7BJjIEU1HntVXr6OEpvMP2rHQeUig== Completed in 36ms npm timing metavuln:cache:get:security-advisory:extract-css:P1r4BlfnfaR6JviqGTgWhyEn5yYOKrSC76ckCSUHdrPet7vqwExLo4exLWNllFvgJe9hZrS/MfwNWmAhojSBAw== Completed in 9ms npm http fetch GET 200 https://registry.npmjs.org/extract-css 16ms (cache hit) npm timing metavuln:packument:extract-css Completed in 20ms npm timing metavuln:load:security-advisory:extract-css:4c1ailpvRUItQsYML6L7TNbUFAAni5Iuc+02yzAOs2i/t4acl+QxR906Oix4foqmwpkzVqqlkhXT02mmEzMEqg== Completed in 1ms npm timing metavuln:calculate:security-advisory:extract-css:4c1ailpvRUItQsYML6L7TNbUFAAni5Iuc+02yzAOs2i/t4acl+QxR906Oix4foqmwpkzVqqlkhXT02mmEzMEqg== Completed in 23ms npm timing metavuln:cache:get:security-advisory:extract-css:tFoazolw6WduHUGPmItsUa3kd+/aJQ/iSFbTL0JY5zv+h0lgQELvstL5x9z8BYkcNrM9Oa3HtKRZtLAkhMjoYw== Completed in 4ms npm timing metavuln:load:security-advisory:extract-css:AAY/vUQaqAP5EpvSIe9gOqIDtCFFftGz3nwCByUUsosTgMuKmOn6mADH+i3uYGVZryHSCgXixI4W2Gp0kyFtiA== Completed in 0ms npm timing metavuln:calculate:security-advisory:extract-css:AAY/vUQaqAP5EpvSIe9gOqIDtCFFftGz3nwCByUUsosTgMuKmOn6mADH+i3uYGVZryHSCgXixI4W2Gp0kyFtiA== Completed in 6ms npm timing metavuln:cache:get:security-advisory:inline-css:Fs1E4BeABqnxNJChJ/I6sSLy9fYbfTpWuFvxDQ8CwTNImkOrn4jUrzhDWsKmWKWKcxUaUYZH09JXQeRP3Ciw3A== Completed in 6ms npm timing metavuln:load:security-advisory:inline-css:P1r4BlfnfaR6JviqGTgWhyEn5yYOKrSC76ckCSUHdrPet7vqwExLo4exLWNllFvgJe9hZrS/MfwNWmAhojSBAw== Completed in 1ms npm timing metavuln:calculate:security-advisory:inline-css:P1r4BlfnfaR6JviqGTgWhyEn5yYOKrSC76ckCSUHdrPet7vqwExLo4exLWNllFvgJe9hZrS/MfwNWmAhojSBAw== Completed in 9ms npm timing auditReport:init Completed in 2119ms npm timing reify:audit Completed in 4418ms npm timing reify Completed in 14412ms

up to date, audited 1639 packages in 16s

163 packages are looking for funding
run npm fund for details

24 vulnerabilities (12 moderate, 10 high, 2 critical)

To address issues that do not require attention, run:
npm audit fix

To address all issues (including breaking changes), run:
npm audit fix --force

Run npm audit for details.
npm timing command:install Completed in 14694ms
npm verb exit 0
npm timing npm Completed in 15794ms
npm info ok

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

  System:
    OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (4) x64 unknown
    Memory: 1.68 GB / 3.84 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.5.0 - /usr/local/bin/npm
  npmPackages:
    sharp: ^0.30.3 => 0.30.3
@lovell
Copy link
Owner

lovell commented Mar 29, 2022

Did you see https://sharp.pixelplumbing.com/install#cross-platform ?

If the runtime environment is musl-based Linux (e.g. Alpine) but the install time environment is glibc-based Linux (e.g. Debian), you'll need to pass --platform=linuxmusl at npm install time.

@simplenotezy
Copy link
Author

simplenotezy commented Mar 29, 2022

Thanks for a prompt reply. Yes I did see that part; I've been trying to debug the issue for some time now.

I also did read some counter messages since, who claimed that as long as you used an image such as bullseye or buster it would work out of the box.

I tried configuring my Dockerfile like so:

FROM --platform=linux/amd64 node:16-bullseye-slim
RUN npm install --platform=linuxmusl

@lovell
Copy link
Owner

lovell commented Mar 29, 2022

Make sure you're not populating/copying the node_modules directory from anywhere else - watch out for volumes etc.

@simplenotezy
Copy link
Author

@lovell thanks, already checked that though. I also tried completly removing node_modules before building, just to verify. In my docker-compose I do like this:

    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules

@simplenotezy
Copy link
Author

simplenotezy commented Mar 29, 2022

After tinkering a bit more around, I've managed to get it working with below.

Instead of simply doing:

FROM node:16-bullseye-slim AS development

COPY package*.json ./

RUN npm install

RUN npm install --arch=arm64 --platform=linuxmusl sharp

COPY . .

RUN npm run build

I add another stage like so:

# development builder
FROM node:16-bullseye-slim AS development

COPY package*.json ./

RUN npm install

RUN npm install --arch=arm64 --platform=linuxmusl sharp

COPY . .

RUN npm run build

# development runner (ARM/M1 compatible)
FROM --platform=linux/amd64 node:16-bullseye AS runner

COPY --from=development . .

WORKDIR /usr/src/app

This allows for fast builds (building with FROM --platform=linux/amd64 is terribly slow) as well as ensuring that the "runner" will run in linux/amd64

Then in my docker-compose.yaml I ensure target is runner instead of development:

build:
  context: .
  target: runner
  dockerfile: ./Dockerfile

@lovell
Copy link
Owner

lovell commented Mar 30, 2022

Glad to hear your worked it out for what is a relatively advanced build process, where node_modules is being copied between platforms.

For anyone else coming here, the underlying advice for mixing different flavours of Linux remains the same and applies to all native modules, not just sharp - make sure the libc being used at runtime matches that declared at install time.

@Nimesh-K-Makwana
Copy link

Nimesh-K-Makwana commented Jul 13, 2022

This command worked for me :
RUN npm install --arch=arm64 --platform=linuxmusl sharp

@kasongoyo
Copy link

kasongoyo commented Oct 21, 2022

This fixed my problem #2460 better and elegantly than any other solution proposed here but my case was not entirely similar to the initial problem posted here

@s1nistr4
Copy link

s1nistr4 commented Mar 4, 2024

So many people are reporting this issue yet no fix in sight. I've seen like 10 report of it and the fix is like one line of documentation.

BTW the solution is

npm install --force @img/sharp-linux-x64

@lovell
Copy link
Owner

lovell commented Mar 5, 2024

@s1nistr4 This issue relates to versions of sharp prior to v0.33.0. In your case, where you are using v0.33.0+, you opened #4021 but did not provide the requested information that would have allowed me to help you.

The "fix" you describe is a temporary workaround that I do not recommend. I suspect you've run into npm/cli#4828. There is a link to this known npm bug in the sharp documentation.

I'm going to lock this issue as it does not help people using the latest version.

Repository owner locked and limited conversation to collaborators Mar 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants