lovell / sharp

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
https://sharp.pixelplumbing.com
Apache License 2.0
28.91k stars 1.29k forks source link

Fails to install on AWS ElasticBeanstalk with node16 #3221

Closed guidev closed 2 years ago

guidev commented 2 years ago

UPDATE: This is due to a breaking change in npm v8 that conflicts with Elastic Beanstalk, and is unrelated to sharp. Please see https://github.com/lovell/sharp/issues/3221#issuecomment-1126528844 provided by an AWS employee for a possible workaround.


Hello, I'm trying to update my app to use node16 (currently on node14) on elastic beanstalk.

Unfortunately sharp fails to install with this error:

npm ERR! code 1 npm ERR! path /var/app/staging/node_modules/sharp npm ERR! command failed npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) npm ERR! sharp: Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies npm ERR! sharp: Installation error: EACCES: permission denied, mkdir '/root/.npm'

I have unsafe-perm on via this config file:

.npmrc unsafe-perm=true

I've also tried manually running sudo npm --production install --unsafe-perm inside /var/app/staging but it fails with the same error.

Here's the full eb-engine.log:

2022/05/10 15:50:44.578973 [INFO] Starting... 2022/05/10 15:50:44.579016 [INFO] Starting EBPlatform-PlatformEngine 2022/05/10 15:50:44.579078 [INFO] reading event message file 2022/05/10 15:50:44.579250 [INFO] Engine received EB command userdata-exec 2022/05/10 15:50:45.023063 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:120921790242:stack/awseb-e-msxjp6atc4-stack/5ca07260-d076-11ec-97ab-12cf082cb253 -r AWSEBAutoScalingGroup --region us-east-1 2022/05/10 15:50:45.353062 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:120921790242:stack/awseb-e-msxjp6atc4-stack/5ca07260-d076-11ec-97ab-12cf082cb253 -r AWSEBBeanstalkMetadata --region us-east-1 2022/05/10 15:50:45.723055 [INFO] This is a workflow controlled instance. 2022/05/10 15:50:45.723142 [INFO] Engine command: (env-launch) 2022/05/10 15:50:45.723795 [INFO] Executing instruction: SyncClock 2022/05/10 15:50:45.723800 [INFO] Starting SyncClock 2022/05/10 15:50:45.723811 [INFO] Running command /bin/sh -c /usr/bin/chronyc tracking 2022/05/10 15:50:45.728199 [INFO] Reference ID : A9FEA97B (169.254.169.123) Stratum : 4 Ref time (UTC) : Tue May 10 15:50:44 2022 System time : 0.665550292 seconds slow of NTP time Last offset : -0.000015462 seconds RMS offset : 0.000015462 seconds Frequency : 2.364 ppm slow Residual freq : -7.058 ppm Skew : 1.403 ppm Root delay : 0.000377039 seconds Root dispersion : 0.002131277 seconds Update interval : 2.3 seconds Leap status : Normal 2022/05/10 15:50:45.728220 [INFO] Running command /bin/sh -c /usr/bin/chronyc -a makestep 2022/05/10 15:50:46.396135 [INFO] 200 OK 2022/05/10 15:50:46.396451 [INFO] Skipping Configure OS 2022/05/10 15:50:46.396459 [INFO] Skipping LockGUID 2022/05/10 15:50:46.396464 [INFO] Skipping GenerateEBBanner 2022/05/10 15:50:46.396469 [INFO] Skipping Install Process Manager 2022/05/10 15:50:46.396474 [INFO] Skipping install proxy 2022/05/10 15:50:46.396479 [INFO] Skipping installhealthd 2022/05/10 15:50:46.396483 [INFO] Skipping Install Log Streaming Manager 2022/05/10 15:50:46.396488 [INFO] Skipping install X-Ray 2022/05/10 15:50:46.396493 [INFO] Skipping install Third Party License 2022/05/10 15:50:46.396497 [INFO] Skipping install httpd 2022/05/10 15:50:46.396503 [INFO] Instance has NOT been bootstrapped 2022/05/10 15:50:46.396505 [INFO] Executing instruction: installSqsd 2022/05/10 15:50:46.396509 [INFO] This is a web server environment instance, skip install sqsd daemon ... 2022/05/10 15:50:46.396513 [INFO] Instance has NOT been bootstrapped 2022/05/10 15:50:46.396515 [INFO] Executing instruction: bootstraphealthd 2022/05/10 15:50:46.396519 [INFO] this is an enhanced health env ... 2022/05/10 15:50:46.396529 [INFO] bootstrap healthd.... 2022/05/10 15:50:46.396540 [INFO] Running command /bin/sh -c /usr/bin/id -u healthd || /usr/sbin/useradd --user-group healthd -s /sbin/nologin --create-home 2022/05/10 15:50:46.421949 [INFO] /usr/bin/id: healthd: no such user 2022/05/10 15:50:46.422528 [INFO] bootstrap healthd.... 2022/05/10 15:50:46.422550 [INFO] Running command /bin/sh -c /usr/bin/id -u healthd || /usr/sbin/useradd --user-group healthd -s /sbin/nologin --create-home 2022/05/10 15:50:46.424971 [INFO] 1001 2022/05/10 15:50:46.425156 [INFO] configure bundle log for healthd... 2022/05/10 15:50:46.425197 [INFO] Executing instruction: GetSetupProxyLog 2022/05/10 15:50:46.425305 [INFO] Skipping Install yum packages 2022/05/10 15:50:46.425310 [INFO] Skipping Install default nodejs 2022/05/10 15:50:46.425314 [INFO] Skipping MarkBaked 2022/05/10 15:50:46.425336 [INFO] Instance has NOT been bootstrapped 2022/05/10 15:50:46.425341 [INFO] Executing instruction: TuneSystemSettings 2022/05/10 15:50:46.425344 [INFO] Starting TuneSystemSettings 2022/05/10 15:50:46.425349 [INFO] Instance has NOT been bootstrapped 2022/05/10 15:50:46.425893 [INFO] Executing instruction: GetSetupLogRotate 2022/05/10 15:50:46.425898 [INFO] Initialize LogRotate files and directories 2022/05/10 15:50:46.437948 [INFO] Instance has NOT been bootstrapped 2022/05/10 15:50:46.437965 [INFO] Executing instruction: BootstrapCFNHup 2022/05/10 15:50:46.437968 [INFO] Bootstrap cfn-hup 2022/05/10 15:50:46.439048 [INFO] Copying file /opt/elasticbeanstalk/config/private/aws-eb-command-handler.conf to /etc/cfn/hooks.d/aws-eb-command-handler.conf 2022/05/10 15:50:46.440549 [INFO] Executing instruction: StartCFNHup 2022/05/10 15:50:46.440554 [INFO] Start cfn-hup 2022/05/10 15:50:46.440568 [INFO] Running command /bin/sh -c systemctl is-active cfn-hup.service 2022/05/10 15:50:46.444023 [INFO] Running command /bin/sh -c systemctl is-active cfn-hup.service 2022/05/10 15:50:46.447213 [INFO] Running command /bin/sh -c systemctl show -p PartOf cfn-hup.service 2022/05/10 15:50:46.454637 [INFO] Running command /bin/sh -c systemctl daemon-reload 2022/05/10 15:50:46.517581 [INFO] Running command /bin/sh -c systemctl reset-failed 2022/05/10 15:50:46.521620 [INFO] Running command /bin/sh -c systemctl is-enabled aws-eb.target 2022/05/10 15:50:46.525760 [INFO] Running command /bin/sh -c systemctl enable aws-eb.target 2022/05/10 15:50:46.601102 [INFO] Running command /bin/sh -c systemctl start aws-eb.target 2022/05/10 15:50:46.605593 [INFO] Running command /bin/sh -c systemctl enable cfn-hup.service 2022/05/10 15:50:46.685271 [INFO] Created symlink from /etc/systemd/system/multi-user.target.wants/cfn-hup.service to /etc/systemd/system/cfn-hup.service. 2022/05/10 15:50:46.685300 [INFO] Running command /bin/sh -c systemctl show -p PartOf cfn-hup.service 2022/05/10 15:50:46.689897 [INFO] Running command /bin/sh -c systemctl is-active cfn-hup.service 2022/05/10 15:50:46.693003 [INFO] Running command /bin/sh -c systemctl start cfn-hup.service 2022/05/10 15:50:46.731113 [INFO] Instance has NOT been bootstrapped 2022/05/10 15:50:46.731127 [INFO] Executing instruction: SetupPublishLogCronjob 2022/05/10 15:50:46.731131 [INFO] Setup publish logs cron job... 2022/05/10 15:50:46.731136 [INFO] Copying file /opt/elasticbeanstalk/config/private/logtasks/cron/publishlogs to /etc/cron.d/publishlogs 2022/05/10 15:50:46.732858 [INFO] Instance has NOT been bootstrapped 2022/05/10 15:50:46.732868 [INFO] Executing instruction: MarkBootstrapped 2022/05/10 15:50:46.732871 [INFO] Starting MarkBootstrapped 2022/05/10 15:50:46.732876 [INFO] Instance has NOT been bootstrapped 2022/05/10 15:50:46.732924 [INFO] Marked instance as Bootstrapped 2022/05/10 15:50:46.732929 [INFO] Executing instruction: Save CFN Stack Info 2022/05/10 15:50:46.732968 [INFO] Starting SwitchCFNStack 2022/05/10 15:50:46.732973 [INFO] Executing cleanup logic 2022/05/10 15:50:46.732981 [INFO] Platform Engine finished execution on command: env-launch 2022/05/10 15:50:51.072344 [INFO] Starting... 2022/05/10 15:50:51.072388 [INFO] Starting EBPlatform-PlatformEngine 2022/05/10 15:50:51.072406 [INFO] reading event message file 2022/05/10 15:50:51.072558 [INFO] Engine received EB command cfn-hup-exec 2022/05/10 15:50:51.189490 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:120921790242:stack/awseb-e-msxjp6atc4-stack/5ca07260-d076-11ec-97ab-12cf082cb253 -r AWSEBAutoScalingGroup --region us-east-1 2022/05/10 15:50:51.584167 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:120921790242:stack/awseb-e-msxjp6atc4-stack/5ca07260-d076-11ec-97ab-12cf082cb253 -r AWSEBBeanstalkMetadata --region us-east-1 2022/05/10 15:50:52.100532 [INFO] checking whether command app-deploy is applicable to this instance... 2022/05/10 15:50:52.100543 [INFO] this command is applicable to the instance, thus instance should execute command 2022/05/10 15:50:52.100546 [INFO] Engine command: (app-deploy) 2022/05/10 15:50:52.100549 [INFO] Downloading EB Application... 2022/05/10 15:50:52.100552 [INFO] Region: us-east-1 2022/05/10 15:50:52.100554 [INFO] envID: e-msxjp6atc4 2022/05/10 15:50:52.100556 [INFO] envBucket: elasticbeanstalk-us-east-1-120921790242 2022/05/10 15:50:52.100559 [INFO] Using manifest file name from command request 2022/05/10 15:50:52.100564 [INFO] Unable to get version manifest file. 2022/05/10 15:50:52.100570 [INFO] Downloading latest manifest available. 2022/05/10 15:50:52.100572 [INFO] Download latest app version manifest 2022/05/10 15:50:52.100648 [INFO] resources/environments/e-msxjp6atc4/_runtime/versions/manifest 2022/05/10 15:50:52.154287 [INFO] latestManifest key *: resources/environments/e-msxjp6atc4/_runtime/versions/manifest_1652197784826 2022/05/10 15:50:52.154430 [INFO] Downloading: bucket: elasticbeanstalk-us-east-1-120921790242, object: /resources/environments/e-msxjp6atc4/_runtime/versions/manifest_1652197784826 2022/05/10 15:50:52.177944 [INFO] Download successful148bytes downloaded 2022/05/10 15:50:52.178024 [INFO] Trying to read and parse version manifest... 2022/05/10 15:50:52.178093 [INFO] Downloading: bucket: elasticbeanstalk-us-east-1-120921790242, object: /resources/environments/e-msxjp6atc4/_runtime/_versions/brass/app-1965-220510_174928905495 2022/05/10 15:50:52.231668 [INFO] Download successful2165517bytes downloaded 2022/05/10 15:50:52.232488 [INFO] Executing instruction: ElectLeader 2022/05/10 15:50:52.232497 [INFO] Running leader election for instance i-01eb50c7b1bed866c... 2022/05/10 15:50:52.232501 [INFO] Calling the cfn-elect-cmd-leader to elect the command leader. 2022/05/10 15:50:52.232513 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-elect-cmd-leader --stack arn:aws:cloudformation:us-east-1:120921790242:stack/awseb-e-msxjp6atc4-stack/5ca07260-d076-11ec-97ab-12cf082cb253 --command-name ElasticBeanstalkCommand-AWSEBAutoScalingGroup --invocation-id 2e4c85fc-59a8-4885-b080-d6ed67f1022c --listener-id i-01eb50c7b1bed866c --region us-east-1 2022/05/10 15:50:52.502591 [INFO] Instance is Leader. 2022/05/10 15:50:52.502628 [INFO] Executing instruction: stopSqsd 2022/05/10 15:50:52.502633 [INFO] This is a web server environment instance, skip stop sqsd daemon ... 2022/05/10 15:50:52.502636 [INFO] Executing instruction: PreBuildEbExtension 2022/05/10 15:50:52.502639 [INFO] Starting executing the config set Infra-EmbeddedPreBuild. 2022/05/10 15:50:52.502653 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-init -s arn:aws:cloudformation:us-east-1:120921790242:stack/awseb-e-msxjp6atc4-stack/5ca07260-d076-11ec-97ab-12cf082cb253 -r AWSEBAutoScalingGroup --region us-east-1 --configsets Infra-EmbeddedPreBuild 2022/05/10 15:51:08.898822 [INFO] Finished executing the config set Infra-EmbeddedPreBuild. 2022/05/10 15:51:08.898844 [INFO] Executing instruction: StageApplication 2022/05/10 15:51:08.898968 [INFO] extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ 2022/05/10 15:51:08.898981 [INFO] Running command /bin/sh -c /usr/bin/unzip -q -o /opt/elasticbeanstalk/deployment/app_source_bundle -d /var/app/staging/ 2022/05/10 15:51:08.920534 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully 2022/05/10 15:51:08.921682 [INFO] Executing instruction: RunAppDeployPreBuildHooks 2022/05/10 15:51:08.921726 [INFO] Executing platform hooks in .platform/hooks/prebuild/ 2022/05/10 15:51:08.921744 [INFO] The dir .platform/hooks/prebuild/ does not exist 2022/05/10 15:51:08.921747 [INFO] Finished running scripts in /var/app/staging/.platform/hooks/prebuild 2022/05/10 15:51:08.921751 [INFO] Executing instruction: Install customer specified node.js version 2022/05/10 15:51:08.921754 [INFO] installing specified nodejs version... 2022/05/10 15:51:08.922361 [INFO] Running command /bin/sh -c uname -m 2022/05/10 15:51:08.923910 [INFO] x86_64 2022/05/10 15:51:08.924332 [INFO] installing node version 16.14.2 2022/05/10 15:51:08.924360 [INFO] Running command /bin/sh -c uname -m 2022/05/10 15:51:08.925707 [INFO] x86_64 2022/05/10 15:51:08.925721 [INFO] Downloading file with path: /tmp/node-v16.14.2-linux-x64.tar.gz 2022/05/10 15:51:08.925787 [INFO] URL: https://elasticbeanstalk-platform-assets-us-east-1.s3.amazonaws.com/stalks/eb_nodejs16_amazon_linux_2_1.0.1520.0_20220422190612/lib/node-v16.14.2-linux-x64.tar.gz 2022/05/10 15:51:09.262896 [INFO] Finished download file from https://elasticbeanstalk-platform-assets-us-east-1.s3.amazonaws.com/stalks/eb_nodejs16_amazon_linux_2_1.0.1520.0_20220422190612/lib/node-v16.14.2-linux-x64.tar.gz 2022/05/10 15:51:09.262946 [INFO] extracting /tmp/node-v16.14.2-linux-x64.tar.gz to /opt/elasticbeanstalk/node-install 2022/05/10 15:51:09.262962 [INFO] Running command /bin/sh -c /usr/bin/tar -xzf /tmp/node-v16.14.2-linux-x64.tar.gz -C /opt/elasticbeanstalk/node-install 2022/05/10 15:51:10.113575 [INFO] finished extracting /tmp/node-v16.14.2-linux-x64.tar.gz to /opt/elasticbeanstalk/node-install successfully 2022/05/10 15:51:10.118067 [INFO] create soft link from /opt/elasticbeanstalk/node-install/node-v16.14.2-linux-x64/bin/node to /usr/bin/node 2022/05/10 15:51:10.118124 [INFO] create soft link from /opt/elasticbeanstalk/node-install/node-v16.14.2-linux-x64/bin/corepack to /usr/bin/corepack 2022/05/10 15:51:10.118170 [INFO] create soft link from /opt/elasticbeanstalk/node-install/node-v16.14.2-linux-x64/bin/npx to /usr/bin/npx 2022/05/10 15:51:10.118206 [INFO] create soft link from /opt/elasticbeanstalk/node-install/node-v16.14.2-linux-x64/bin/npm to /usr/bin/npm 2022/05/10 15:51:10.118229 [INFO] Executing instruction: Use NPM to install dependencies 2022/05/10 15:51:10.118242 [INFO] use npm to install dependencies 2022/05/10 15:51:10.118282 [INFO] Running command /bin/sh -c npm config set jobs 1 2022/05/10 15:51:10.440114 [INFO] Running command /bin/sh -c npm --production install 2022/05/10 15:51:33.406177 [INFO] npm notice npm notice New minor version of npm available! 8.5.0 -> 8.9.0 npm notice Changelog: npm notice Run `npm install -g npm@8.9.0` to update! npm notice npm ERR! code 1 npm ERR! path /var/app/staging/node_modules/sharp npm ERR! command failed npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) npm ERR! sharp: Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies npm ERR! sharp: Installation error: EACCES: permission denied, mkdir '/root/.npm' npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-05-10T15_51_10_592Z-debug-0.log 2022/05/10 15:51:33.406218 [ERROR] An error occurred during execution of command [app-deploy] - [Use NPM to install dependencies]. Stop running the command. Error: Command /bin/sh -c npm --production install failed with error exit status 1. Stderr:npm notice npm notice New minor version of npm available! 8.5.0 -> 8.9.0 npm notice Changelog: npm notice Run `npm install -g npm@8.9.0` to update! npm notice npm ERR! code 1 npm ERR! path /var/app/staging/node_modules/sharp npm ERR! command failed npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) npm ERR! sharp: Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies npm ERR! sharp: Installation error: EACCES: permission denied, mkdir '/root/.npm' npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-05-10T15_51_10_592Z-debug-0.log 2022/05/10 15:51:33.406222 [INFO] Executing cleanup logic 2022/05/10 15:51:33.406319 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment: 'npm' failed to install dependencies that you defined in 'package.json'. For details, see 'eb-engine.log'. The deployment failed.","timestamp":1652197893406,"severity":"ERROR"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1652197893406,"severity":"ERROR"}]}]} 2022/05/10 15:51:33.406499 [INFO] Platform Engine finished execution on command: app-deploy 2022/05/10 15:51:36.948439 [INFO] Starting... 2022/05/10 15:51:36.948474 [INFO] Starting EBPlatform-PlatformEngine 2022/05/10 15:51:36.948496 [INFO] reading event message file 2022/05/10 15:51:36.948645 [INFO] Engine received EB command cfn-hup-exec 2022/05/10 15:51:37.034035 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:120921790242:stack/awseb-e-msxjp6atc4-stack/5ca07260-d076-11ec-97ab-12cf082cb253 -r AWSEBAutoScalingGroup --region us-east-1 2022/05/10 15:51:37.364862 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:120921790242:stack/awseb-e-msxjp6atc4-stack/5ca07260-d076-11ec-97ab-12cf082cb253 -r AWSEBBeanstalkMetadata --region us-east-1 2022/05/10 15:51:37.674211 [INFO] checking whether command bundle-log is applicable to this instance... 2022/05/10 15:51:37.674220 [INFO] this command is applicable to the instance, thus instance should execute command 2022/05/10 15:51:37.674223 [INFO] Engine command: (bundle-log) 2022/05/10 15:51:37.674267 [INFO] Executing instruction: GetBundleLogs 2022/05/10 15:51:37.674271 [INFO] Bundle Logs...

Possible install-time or require-time problem

Are you using the latest version of sharp?

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of sharp that is not the latest, please open an issue against that package instead.

Is this a problem with filesystem permissions?

If you are using npm v6 or earlier and installing as a root or sudo user, have you tried with the npm install --unsafe-perm flag?

If you are using npm v7 or later, does the user running npm install own the directory it is run in?

If you are using the ignore-scripts feature of npm, have you tried with the npm install --ignore-scripts=false flag?

What is the complete output of running npm install --verbose --foreground-scripts sharp in an empty directory?

npm verb cli [ npm verb cli '/opt/elasticbeanstalk/node-install/node-v16.14.2-linux-x64/bin/node', npm verb cli '/usr/bin/npm', npm verb cli 'install', npm verb cli '--verbose', npm verb cli '--foreground-scripts', 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 0ms npm timing config:load:defaults Completed in 2ms npm timing config:load:file:/opt/elasticbeanstalk/node-install/node-v16.14.2-linux-x64/lib/node_modules/npm/npmrc Completed in 0ms npm timing config:load:builtin Completed in 0ms npm timing config:load:cli Completed in 1ms npm timing config:load:env Completed in 1ms npm timing config:load:project Completed in 13ms npm timing config:load:file:/home/ec2-user/.npmrc Completed in 2ms npm timing config:load:user Completed in 2ms npm timing config:load:file:/opt/elasticbeanstalk/node-install/node-v16.14.2-linux-x64/etc/npmrc Completed in 0ms npm timing config:load:global Completed in 0ms npm timing config:load:validate Completed in 0ms npm timing config:load:credentials Completed in 1ms npm timing config:load:setEnvs Completed in 1ms npm timing config:load Completed in 22ms npm timing npm:load:configload Completed in 22ms npm timing npm:load:setTitle Completed in 0ms npm timing config:load:flatten Completed in 3ms npm timing npm:load:display Completed in 11ms npm verb logfile /home/ec2-user/.npm/_logs/2022-05-10T16_09_10_792Z-debug-0.log npm timing npm:load:logFile Completed in 5ms npm timing npm:load:timers Completed in 0ms npm timing npm:load:configScope Completed in 0ms npm timing npm:load Completed in 40ms npm timing arborist:ctor Completed in 1ms npm timing arborist:ctor Completed in 0ms npm timing idealTree:init Completed in 9ms npm timing idealTree:userRequests Completed in 1ms npm http fetch GET 200 https://registry.npmjs.org/sharp 67ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color 71ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/detect-libc 74ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/tar-fs 72ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/semver 74ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent 73ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 80ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/simple-get 188ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 221ms (cache miss) npm timing idealTree:#root Completed in 301ms npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 71ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/node-abi 71ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color-string 77ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color-convert 80ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/github-from-package 79ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 78ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/minimist 80ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/npmlog 80ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/rc 81ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/simple-concat 79ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/expand-template 86ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/chownr 80ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/tar-stream 79ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/once 90ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/decompress-response 93ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/pump 100ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/safe-buffer 192ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/lru-cache 213ms (cache miss) npm timing idealTree:node_modules/sharp Completed in 240ms npm http fetch GET 200 https://registry.npmjs.org/color-name 28ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 52ms (cache miss) npm timing idealTree:node_modules/color Completed in 60ms npm timing idealTree:node_modules/color-convert Completed in 2ms npm timing idealTree:node_modules/color-name Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 34ms (cache miss) npm timing idealTree:node_modules/color-string Completed in 36ms npm timing idealTree:node_modules/detect-libc Completed in 0ms npm timing idealTree:node_modules/node-addon-api Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/gauge 54ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments 53ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/ini 56ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/console-control-strings 61ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/deep-extend 60ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/set-blocking 61ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/end-of-stream 67ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet 76ms (cache miss) npm timing idealTree:node_modules/prebuild-install Completed in 87ms npm timing idealTree:node_modules/expand-template Completed in 0ms npm timing idealTree:node_modules/github-from-package Completed in 0ms npm timing idealTree:node_modules/minimist Completed in 0ms npm timing idealTree:node_modules/mkdirp-classic Completed in 0ms npm timing idealTree:node_modules/napi-build-utils Completed in 0ms npm timing idealTree:node_modules/node-abi Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/string-width 34ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/has-unicode 39ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 45ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/object-assign 54ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/readable-stream 58ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/signal-exit 59ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/aproba 63ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/delegates 67ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/wide-align 64ms (cache miss) npm timing idealTree:node_modules/npmlog Completed in 73ms npm http fetch GET 200 https://registry.npmjs.org/string_decoder 33ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/process-nextick-args 38ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/inherits 49ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/core-util-is 53ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/isarray 57ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/util-deprecate 147ms (cache miss) npm timing idealTree:node_modules/are-we-there-yet Completed in 158ms npm timing idealTree:node_modules/console-control-strings Completed in 0ms npm timing idealTree:node_modules/delegates Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/ansi-regex 36ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point 37ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/code-point-at 40ms (cache miss) npm timing idealTree:node_modules/gauge Completed in 49ms npm timing idealTree:node_modules/aproba Completed in 0ms npm timing idealTree:node_modules/has-unicode Completed in 0ms npm timing idealTree:node_modules/object-assign Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/wrappy 62ms (cache miss) npm timing idealTree:node_modules/pump Completed in 67ms npm timing idealTree:node_modules/end-of-stream Completed in 0ms npm timing idealTree:node_modules/once Completed in 1ms npm timing idealTree:node_modules/rc Completed in 2ms npm timing idealTree:node_modules/deep-extend Completed in 0ms npm timing idealTree:node_modules/ini Completed in 0ms npm timing idealTree:node_modules/readable-stream Completed in 5ms npm timing idealTree:node_modules/core-util-is Completed in 0ms npm timing idealTree:node_modules/inherits Completed in 0ms npm timing idealTree:node_modules/isarray Completed in 0ms npm timing idealTree:node_modules/process-nextick-args Completed in 0ms npm timing idealTree:node_modules/safe-buffer Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/yallist 36ms (cache miss) npm timing idealTree:node_modules/semver Completed in 38ms npm timing idealTree:node_modules/lru-cache Completed in 2ms npm timing idealTree:node_modules/set-blocking Completed in 0ms npm timing idealTree:node_modules/signal-exit Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/mimic-response 40ms (cache miss) npm timing idealTree:node_modules/simple-get Completed in 44ms npm timing idealTree:node_modules/decompress-response Completed in 1ms npm timing idealTree:node_modules/mimic-response Completed in 0ms npm timing idealTree:node_modules/simple-concat Completed in 0ms npm timing idealTree:node_modules/simple-swizzle Completed in 1ms npm timing idealTree:node_modules/is-arrayish Completed in 0ms npm timing idealTree:node_modules/string_decoder Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/number-is-nan 25ms (cache miss) npm timing idealTree:node_modules/string-width Completed in 29ms npm timing idealTree:node_modules/code-point-at Completed in 0ms npm timing idealTree:node_modules/is-fullwidth-code-point Completed in 1ms npm timing idealTree:node_modules/number-is-nan Completed in 0ms npm timing idealTree:node_modules/strip-ansi Completed in 1ms npm timing idealTree:node_modules/ansi-regex Completed in 0ms npm timing idealTree:node_modules/strip-json-comments Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/bl 33ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/fs-constants 37ms (cache miss) npm timing idealTree:node_modules/tar-fs Completed in 42ms npm timing idealTree:node_modules/chownr Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/buffer 29ms (cache miss) npm timing idealTree:node_modules/tar-stream Completed in 37ms npm http fetch GET 200 https://registry.npmjs.org/base64-js 27ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/ieee754 27ms (cache miss) npm timing idealTree:node_modules/bl Completed in 31ms npm timing idealTree:node_modules/buffer Completed in 1ms npm timing idealTree:node_modules/base64-js Completed in 0ms npm timing idealTree:node_modules/fs-constants Completed in 0ms npm timing idealTree:node_modules/ieee754 Completed in 0ms npm timing idealTree:node_modules/tunnel-agent Completed in 0ms npm timing idealTree:node_modules/util-deprecate Completed in 0ms npm timing idealTree:node_modules/wide-align Completed in 0ms npm timing idealTree:node_modules/wrappy Completed in 0ms npm timing idealTree:node_modules/yallist Completed in 0ms npm timing idealTree:node_modules/bl/node_modules/readable-stream Completed in 0ms npm timing idealTree:node_modules/tar-stream/node_modules/readable-stream Completed in 0ms npm timing idealTree:buildDeps Completed in 1326ms npm timing idealTree:fixDepFlags Completed in 2ms npm timing idealTree Completed in 1341ms npm timing reify:loadTrees Completed in 1341ms npm timing reify:diffTrees Completed in 2ms npm timing reify:retireShallow Completed in 1ms npm timing reify:createSparse Completed in 30ms npm timing reify:loadBundles Completed in 0ms npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 529ms npm timing auditReport:getReport Completed in 533ms npm timing auditReport:init Completed in 0ms npm timing reify:audit Completed in 535ms npm http fetch GET 200 https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz 2106ms (cache miss) npm timing reifyNode:node_modules/fs-constants Completed in 2163ms npm http fetch GET 200 https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz 2125ms (cache miss) npm timing reifyNode:node_modules/ieee754 Completed in 2171ms npm http fetch GET 200 https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz 2050ms (cache miss) npm timing reifyNode:node_modules/end-of-stream Completed in 2257ms npm http fetch GET 200 https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz 2192ms (cache miss) npm timing reifyNode:node_modules/mimic-response Completed in 2288ms npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz 2226ms (cache miss) npm timing reifyNode:node_modules/is-fullwidth-code-point Completed in 2308ms npm http fetch GET 200 https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz 2204ms (cache miss) npm timing reifyNode:node_modules/decompress-response Completed in 2312ms npm http fetch GET 200 https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz 2212ms (cache miss) npm timing reifyNode:node_modules/simple-concat Completed in 2315ms npm http fetch GET 200 https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz 2127ms (cache miss) npm timing reifyNode:node_modules/wrappy Completed in 2321ms npm http fetch GET 200 https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz 2264ms (cache miss) npm timing reifyNode:node_modules/ansi-regex Completed in 2337ms npm http fetch GET 200 https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz 2149ms (cache miss) npm timing reifyNode:node_modules/deep-extend Completed in 2340ms npm http fetch GET 200 https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz 2167ms (cache miss) npm timing reifyNode:node_modules/core-util-is Completed in 2343ms npm http fetch GET 200 https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz 2306ms (cache miss) npm timing reifyNode:node_modules/base64-js Completed in 2354ms npm http fetch GET 200 https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz 2292ms (cache miss) npm timing reifyNode:node_modules/chownr Completed in 2362ms npm http fetch GET 200 https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz 2156ms (cache miss) npm timing reifyNode:node_modules/wide-align Completed in 2365ms npm http fetch GET 200 https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz 2159ms (cache miss) npm timing reifyNode:node_modules/strip-ansi Completed in 2371ms npm http fetch GET 200 https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz 2292ms (cache miss) npm timing reifyNode:node_modules/code-point-at Completed in 2382ms npm http fetch GET 200 https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz 2172ms (cache miss) npm timing reifyNode:node_modules/string-width Completed in 2389ms npm http fetch GET 200 https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz 2097ms (cache miss) npm timing reifyNode:node_modules/delegates Completed in 2393ms npm http fetch GET 200 https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz 2097ms (cache miss) npm timing reifyNode:node_modules/set-blocking Completed in 2400ms npm http fetch GET 200 https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz 2053ms (cache miss) npm timing reifyNode:node_modules/color-name Completed in 2427ms npm http fetch GET 200 https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz 2060ms (cache miss) npm timing reifyNode:node_modules/color-string Completed in 2437ms npm http fetch GET 200 https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz 2078ms (cache miss) npm timing reifyNode:node_modules/expand-template Completed in 2442ms npm http fetch GET 200 https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz 2028ms (cache miss) npm timing reifyNode:node_modules/simple-get Completed in 2448ms npm http fetch GET 200 https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz 2287ms (cache miss) npm timing reifyNode:node_modules/inherits Completed in 2460ms npm http fetch GET 200 https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz 2388ms (cache miss) npm timing reifyNode:node_modules/number-is-nan Completed in 2467ms npm http fetch GET 200 https://registry.npmjs.org/pump/-/pump-3.0.0.tgz 2149ms (cache miss) npm timing reifyNode:node_modules/pump Completed in 2484ms npm http fetch GET 200 https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz 2426ms (cache miss) npm timing reifyNode:node_modules/tar-stream Completed in 2494ms npm http fetch GET 200 https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz 2381ms (cache miss) npm timing reifyNode:node_modules/yallist Completed in 2497ms npm http fetch GET 200 https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz 2333ms (cache miss) npm timing reifyNode:node_modules/process-nextick-args Completed in 2500ms npm http fetch GET 200 https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz 2281ms (cache miss) npm timing reifyNode:node_modules/object-assign Completed in 2509ms npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz 2169ms (cache miss) npm timing reifyNode:node_modules/napi-build-utils Completed in 2517ms npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz 2148ms (cache miss) npm timing reifyNode:node_modules/simple-swizzle Completed in 2520ms npm http fetch GET 200 https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz 2409ms (cache miss) npm timing reifyNode:node_modules/lru-cache Completed in 2528ms npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz 2349ms (cache miss) npm timing reifyNode:node_modules/strip-json-comments Completed in 2535ms npm http fetch GET 200 https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz 2418ms (cache miss) npm timing reifyNode:node_modules/util-deprecate Completed in 2546ms npm http fetch GET 200 https://registry.npmjs.org/ini/-/ini-1.3.8.tgz 2361ms (cache miss) npm timing reifyNode:node_modules/ini Completed in 2549ms npm http fetch GET 200 https://registry.npmjs.org/once/-/once-1.4.0.tgz 2352ms (cache miss) npm timing reifyNode:node_modules/once Completed in 2552ms npm http fetch GET 200 https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz 2240ms (cache miss) npm timing reifyNode:node_modules/console-control-strings Completed in 2559ms npm http fetch GET 200 https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz 2426ms (cache miss) npm timing reifyNode:node_modules/string_decoder Completed in 2564ms npm http fetch GET 200 https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz 2418ms (cache miss) npm timing reifyNode:node_modules/safe-buffer Completed in 2573ms npm http fetch GET 200 https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz 2341ms (cache miss) npm timing reifyNode:node_modules/aproba Completed in 2575ms npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz 2229ms (cache miss) npm timing reifyNode:node_modules/mkdirp-classic Completed in 2581ms npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz 2287ms (cache miss) npm timing reifyNode:node_modules/are-we-there-yet Completed in 2612ms npm http fetch GET 200 https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz 2455ms (cache miss) npm timing reifyNode:node_modules/isarray Completed in 2626ms npm http fetch GET 200 https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz 2408ms (cache miss) npm timing reifyNode:node_modules/signal-exit Completed in 2629ms npm http fetch GET 200 https://registry.npmjs.org/color/-/color-4.2.3.tgz 2193ms (cache miss) npm timing reifyNode:node_modules/color Completed in 2634ms npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz 2230ms (cache miss) npm timing reifyNode:node_modules/tunnel-agent Completed in 2641ms npm http fetch GET 200 https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz 2314ms (cache miss) npm timing reifyNode:node_modules/npmlog Completed in 2653ms npm http fetch GET 200 https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz 2426ms (cache miss) npm timing reifyNode:node_modules/has-unicode Completed in 2658ms npm http fetch GET 200 https://registry.npmjs.org/bl/-/bl-4.1.0.tgz 2606ms (cache miss) npm timing reifyNode:node_modules/bl Completed in 2667ms npm http fetch GET 200 https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz 2579ms (cache miss) npm timing reifyNode:node_modules/is-arrayish Completed in 2673ms npm http fetch GET 200 https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz 2629ms (cache miss) npm timing reifyNode:node_modules/buffer Completed in 2680ms npm http fetch GET 200 https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz 2289ms (cache miss) npm timing reifyNode:node_modules/color-convert Completed in 2684ms npm http fetch GET 200 https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz 2263ms (cache miss) npm timing reifyNode:node_modules/detect-libc Completed in 2701ms npm http fetch GET 200 https://registry.npmjs.org/node-abi/-/node-abi-3.15.0.tgz 2374ms (cache miss) npm timing reifyNode:node_modules/node-abi Completed in 2716ms npm http fetch GET 200 https://registry.npmjs.org/rc/-/rc-1.2.8.tgz 2406ms (cache miss) npm timing reifyNode:node_modules/rc Completed in 2737ms npm http fetch GET 200 https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.0.tgz 2322ms (cache miss) npm timing reifyNode:node_modules/prebuild-install Completed in 2751ms npm http fetch GET 200 https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz 2444ms (cache miss) npm timing reifyNode:node_modules/gauge Completed in 2759ms npm http fetch GET 200 https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz 2403ms (cache miss) npm timing reifyNode:node_modules/github-from-package Completed in 2763ms npm http fetch GET 200 https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz 2416ms (cache miss) npm timing reifyNode:node_modules/minimist Completed in 2773ms npm http fetch GET 200 https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz 2539ms (cache miss) npm timing reifyNode:node_modules/readable-stream Completed in 2787ms npm http fetch GET 200 https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz 2343ms (cache miss) npm timing reifyNode:node_modules/bl/node_modules/readable-stream Completed in 2798ms npm http fetch GET 200 https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz 2341ms (cache miss) npm timing reifyNode:node_modules/tar-stream/node_modules/readable-stream Completed in 2801ms npm http fetch GET 200 https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz 2373ms (cache miss) npm timing reifyNode:node_modules/node-addon-api Completed in 2808ms npm http fetch GET 200 https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz 2399ms (cache miss) npm timing reifyNode:node_modules/tar-fs Completed in 2815ms npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-7.3.7.tgz 2400ms (cache miss) npm timing reifyNode:node_modules/semver Completed in 2823ms npm http fetch GET 200 https://registry.npmjs.org/sharp/-/sharp-0.30.4.tgz 2494ms (cache miss) npm timing reifyNode:node_modules/sharp Completed in 2958ms npm timing reify:unpack Completed in 2965ms npm timing reify:unretire Completed in 0ms npm timing build:queue Completed in 10ms npm timing build:link:node_modules/prebuild-install Completed in 3ms npm timing build:link:node_modules/rc Completed in 2ms npm timing build:link:node_modules/semver Completed in 2ms npm timing build:link Completed in 3ms npm info run sharp@0.30.4 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) > sharp@0.30.4 install > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-linux-x64.tar.brnstall/dll-copy && prebuild-install) || (node install/can sharp: Integrity check passed for linux-x64n sharp@0.30.4 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can prebuild-install info begin Prebuild-install version 7.1.0install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can prebuild-install info looking for local prebuild @ prebuilds/sharp-v0.30.4-napi-v5-linux-x64.tar.gz prebuild-install info looking for cached prebuild @ /home/ec2-user/.npm/_prebuilds/da932c-sharp-v0.30.4-napi-v5-linux-x64.tar.gz prebuild-install http request GET https://github.com/lovell/sharp/releases/download/v0.30.4/sharp-v0.30.4-napi-v5-linux-x64.tar.gz prebuild-install http 200 https://github.com/lovell/sharp/releases/download/v0.30.4/sharp-v0.30.4-napi-v5-linux-x64.tar.gz/dll-copy && prebuild-install) || (node install/can prebuild-install info downloading to @ /home/ec2-user/.npm/_prebuilds/da932c-sharp-v0.30.4-napi-v5-linux-x64.tar.gz.3164-ef3bf529cd2f1.tmp prebuild-install info renaming to @ /home/ec2-user/.npm/_prebuilds/da932c-sharp-v0.30.4-napi-v5-linux-x64.tar.gzde install/dll-copy && prebuild-install) || (node install/can prebuild-install info unpacking @ /home/ec2-user/.npm/_prebuilds/da932c-sharp-v0.30.4-napi-v5-linux-x64.tar.gz prebuild-install info unpack resolved to /home/ec2-user/node_modules/sharp/build/Release/sharp-linux-x64.node prebuild-install info install Successfully installed prebuilt binary! npm info run sharp@0.30.4 install { code: 0, signal: null } npm timing build:run:install:node_modules/sharp Completed in 4375ms npm timing build:run:install Completed in 4375ms npm timing build:deps Completed in 4390ms npm timing build Completed in 4390ms npm timing reify:build Completed in 4391ms npm timing reify:trash Completed in 0ms npm timing reify:save Completed in 16ms npm timing reify Completed in 8803ms added 67 packages, and audited 68 packages in 9s 8 packages are looking for funding run `npm fund` for details found 0 vulnerabilities npm timing command:install Completed in 8811ms npm notice npm notice New minor version of npm available! 8.5.0 -> 8.9.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.9.0 npm notice Run npm install -g npm@8.9.0 to update! npm notice npm verb exit 0 npm timing npm Completed in 9016ms npm info ok

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

System: OS: Linux 4.14 Amazon Linux 2 CPU: (2) x64 Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Memory: 1.47 GB / 1.91 GB Container: Yes Shell: 4.2.46 - /bin/bash Binaries: Node: 16.14.2 - /usr/bin/node npm: 8.5.0 - /usr/bin/npm npmPackages: sharp: ^0.30.4 => 0.30.4

lovell commented 2 years ago

I'm trying to update my app to use node16 (currently on node14) on elastic beanstalk.

npm ERR! sharp: Installation error: EACCES: permission denied, mkdir '/root/.npm'

Did you see this question in the issue template?

Is this a problem with filesystem permissions?

If you are using npm v7 or later, does the user running npm install own the directory it is run in?

There was a breaking change between npm v6 (Node.js 14) and npm v8 (Node.js 16) relating to filesystem permissions.

guidev commented 2 years ago

ok, so the issue is that /var/app/staging is owned by webapp

ls -la /var/app/
total 0
drwxr-xr-x  3 root   root    21 May 10 17:35 .
drwxr-xr-x 23 root   root   327 May 10 17:35 ..
drwxr-xr-x  8 webapp webapp 226 May 10 17:36 staging

npm install is instead run by root

I'm still unsure on how to fix it, I don't believe elastic beanstalk allows to change which user runs which command...

guidev commented 2 years ago

Another user had the same issue: https://stackoverflow.com/questions/72179711/sharp-js-dependency-breaks-express-server-on-elastic-beanstalk#

lovell commented 2 years ago

It's been a while (c2014) since I last used Elastic Beanstalk, but I remember having to maintain a lot of shell scripts to do anything, hopefully things have improved since then.

Does running npm install as the webapp user help?

sudo -H -u webapp npm install 

Alternatively, does changing the filesystem ownership to root before running npm install work?

chown -R root.root /var/app/staging

I'd like to stress that this problem is caused by a breaking change in npm v8 and not sharp. This problem will affect all native Node.js modules, including sharp, esbuild, etc.

jceduar commented 2 years ago

Hello @guidev ,

I recently found a workaround solution for this error when assisting an AWS customer migrate their environment from Amazon Linux 1 to Amazon Linux 2 using the following Platform Version ("Node.js 16 AL2 version 5.5.2") & Solution Stack Name ("64bit Amazon Linux 2 v5.5.2 running Node.js 16"). I was able to reproduce the error and confirm the deployment was successful in my own test environment.

As mentioned by @lovell , the problem is caused by a breaking change in the npm version. Additionally, the error experienced can be considered an application level dependency problem which falls outside of the AWS Support Scope since it is borderline viewed as "Code development" and/or "Debugging custom software". Please note that AWS Support Engineers help with solutions for technical issues with respect to AWS services and infrastructure. Any assistance provided outside of the support scope is on a "best efforts" basis!


Solution: Step 1: Create the following Platform Hooks paths in the root directory of your application bundle.

-  .platform/hooks/prebuild
-  .platform/confighooks/prebuild

The Platform Hook (.platform/hooks/prebuild) will execute the commands found in the bash script after the application is extracted but before the application configuration and proxy server process initiates.

The Platform Hook (.platform/confighooks/prebuild) will execute the commands found in the bash script during a configuration deployment/environment update.

Please reference the AWS Elastic Beanstalk Documentation, "Instance Deployment Workflow" for more insight.


Step 2: Once the above Platform Hooks paths have been created in your application bundle, the following bash script (00_npm_install.sh) will need to be created and placed under the "Prebuild" directory:

The bash script (00_npm_install.sh) will include the following:

#!/bin/bash
cd /var/app/staging
sudo -u webapp npm install sharp

Please make sure the bash script (00_npm_install.sh) file has execute permissions by using chmod +x.

Example:

chmod +x 00_npm_install.sh

OR

chmod +x .platform/hooks/prebuild/00_npm_install.sh
chmod +x .platform/confighooks/prebuild/00_npm_install.sh

*The above command is dependent on your current working directory. Overall, the bash script should have the following permissions -rwxr-xr-x.


Step 3: Validate the Application Bundle Structure

Sample project structure:

    ~/my-app/
    ├── app.js
    ├── index.html
    ├── .npmrc_bkp
    ├── package.json
    ├── package-lock.json
    ├── .platform
    │   ├── confighooks
    │   │   └── prebuild
    │   │       └── 00_npm_install.sh
    │   └── hooks
    │       └── prebuild
    │           └── 00_npm_install.sh
    └── Procfile

Step 4: Deploy the Application!


Summary:

During the application deployment process, the application bundle is initially extracted and deployed within the /var/app/staging folder. In this same first step, all Node.js dependencies found in your (package.json) file will also be installed here but exist under /var/app/staging/node_modules/....

As mentioned in your comment, the /var/app/staging folder is owned by the webapp user but the npm install command is executed by root user. Therefore, the bash script workaround solution goes to the /var/app/staging/ directory and install the Sharp dependency by executing the sudo -u webapp npm install sharp command as the webapp user. All of this is done before the application and proxy server configuration process initiates as shown in "Instance deployment workflow".

As a result, the workaround solution will make the Elastic Beanstalk deployment process skip installing the Sharp dependency all together as it already exists! Afterwards, the application deployment process continues to the final provisioning step which moves all files/content from the /var/app/staging/ folder to the final /var/app/current/ directory location.

Lastly, the second Platform Hook (.platform/confighooks/prebuild) was implemented to avoid running into the same permissions error when performing a configuration deployment. A configuration deployment occurs when you make configuration changes that only update environment instances without recreating them!

Hope the following solution helps!

guidev commented 2 years ago

Hello @guidev ,

I recently found a workaround solution for this error when assisting an AWS customer migrate their environment from Amazon Linux 1 to Amazon Linux 2 using the following Platform Version ("Node.js 16 AL2 version 5.5.2") & Solution Stack Name ("64bit Amazon Linux 2 v5.5.2 running Node.js 16"). I was able to reproduce the error and confirm the deployment was successful in my own test environment.

As mentioned by @lovell , the problem is caused by a breaking change in the npm version. Additionally, the error experienced can be considered an application level dependency problem which falls outside of the AWS Support Scope since it is borderline viewed as "Code development" and/or "Debugging custom software". Please note that AWS Support Engineers help with solutions for technical issues with respect to AWS services and infrastructure. Any assistance provided outside of the support scope is on a "best efforts" basis!

Solution: Step 1: Create the following Platform Hooks paths in the root directory of your application bundle.

-  .platform/hooks/prebuild
-  .platform/confighooks/prebuild

The Platform Hook (.platform/hooks/prebuild) will execute the commands found in the bash script after the application is extracted but before the application configuration and proxy server process initiates.

The Platform Hook (.platform/confighooks/prebuild) will execute the commands found in the bash script during a configuration deployment/environment update.

Please reference the AWS Elastic Beanstalk Documentation, "Instance Deployment Workflow" for more insight.

Step 2: Once the above Platform Hooks paths have been created in your application bundle, the following bash script (00_npm_install.sh) will need to be created and placed under the "Prebuild" directory:

The bash script (00_npm_install.sh) will include the following:

#!/bin/bash
cd /var/app/staging
sudo -u webapp npm install sharp

Please make sure the bash script (00_npm_install.sh) file has execute permissions by using chmod +x.

Example:

chmod +x 00_npm_install.sh

OR

chmod +x .platform/hooks/prebuild/00_npm_install.sh
chmod +x .platform/confighooks/prebuild/00_npm_install.sh

*The above command is dependent on your current working directory. Overall, the bash script should have the following permissions -rwxr-xr-x.

Step 3: Validate the Application Bundle Structure

Sample project structure:

    ~/my-app/
    ├── app.js
    ├── index.html
    ├── .npmrc_bkp
    ├── package.json
    ├── package-lock.json
    ├── .platform
    │   ├── confighooks
    │   │   └── prebuild
    │   │       └── 00_npm_install.sh
    │   └── hooks
    │       └── prebuild
    │           └── 00_npm_install.sh
    └── Procfile

Step 4: Deploy the Application!

Summary:

During the application deployment process, the application bundle is initially extracted and deployed within the /var/app/staging folder. In this same first step, all Node.js dependencies found in your (package.json) file will also be installed here but exist under /var/app/staging/node_modules/....

As mentioned in your comment, the /var/app/staging folder is owned by the webapp user but the npm install command is executed by root user. Therefore, the bash script workaround solution goes to the /var/app/staging/ directory and install the Sharp dependency by executing the sudo -u webapp npm install sharp command as the webapp user. All of this is done before the application and proxy server configuration process initiates as shown in "Instance deployment workflow".

As a result, the workaround solution will make the Elastic Beanstalk deployment process skip installing the Sharp dependency all together as it already exists! Afterwards, the application deployment process continues to the final provisioning step which moves all files/content from the /var/app/staging/ folder to the final /var/app/current/ directory location.

Lastly, the second Platform Hook (.platform/confighooks/prebuild) was implemented to avoid running into the same permissions error when performing a configuration deployment. A configuration deployment occurs when you make configuration changes that only update environment instances without recreating them!

Hope the following solution helps!

Thanks @jceduar for the detailed explanation, your solution worked like a charm!!

tolgaatam commented 2 years ago

@jceduar your solution works correctly. Most answers online must be referring to the previous Linux AMI version where .ebextensions or .npmrc worked as expected. I also had several old projects which were deployed this way. I recently started a new project by copying the skeleton of one of the previous ones, but could not deploy due to this problem. You saved my life. This reply needs more upvotes/hearts and someone who has enough reputation should also submit this solution on stackoverflow :)

rolanday commented 2 years ago

@jceduar, thanks a ton for taking the time to investigate and post a solution! I'm sure you saved me MANY hours!! Your solution cleanly addressed the issue :-)

After clearing the above hurdle, I did run into one minor speedbump where npm was ENOMEM'ing after adding sharp to my package. I was on t2.small, and same issue for t2.med. Once bumped up to t2.large, deployment went smoothly, and I verified sharp package works. This was just a side app inside clean nestjs install that I used to validate above solution works. My real service runs on graviton t4g.med, and I had no such issues so not going to bother finding work around to the mem issue. I've read that some folks configure a swap file when running into this problem with other packages when deploying to beanstalk.

ubeytd commented 1 year ago

@guidev thanks for the tip!

It made my life easier when I deploy directus9 to elasticbeanstalk :) 💪

jeremyisatrecharm commented 1 year ago

Even if https://github.com/lovell/sharp/issues/3221#issuecomment-1126783576 works, it's a pretty bad situation that users of Beanstalk have to resort to shims to get a fundamental situation like installing dependencies working. I don't mean to disparage the work of the author, it's very helpful seeing the solution and understanding what's going on... but basically AWS Beanstalk doesn't work for Node 16; and to cope, we have to duplicate our dependencies... It's very easy now to forget to update a dependency in the shim, or future dependencies could have the same issue leading to another wild-goose-chase on deploy (I saw this issue from the @sentry npm module).

Does anyone know if Amazon is working on a solution here?

tolgaatam commented 1 year ago

@jeremyisatrecharm having used elastic beanstalk for 5 years, I'm pretty sure that this is something they won't fix for a long time. Because of this, I think the @guidev 's solution deserves a praise.

However, I agree with you on the fact that one can easily forget to update the beanstalk platform scripts and fail a deployment. sudo -u webapp npm install sharp must be installing the latest version of sharp, which then could be incompatible with the node version you are using on elastic beanstalk. This is really prone to error.

Off the top of my head, I thought of a solution for this. For the sake of example, let's exemplify the case where we use zip files for elastic beanstalk deployments.

For each of my projects that I deploy to Elastic beanstalk, I have a script called make_zip.sh which simply zips the directory by excluding some unwanted files/folders. It is really a single line script now. You could have a script like this, but before the zipping operation, you can call a nodejs script which checks package-lock.json or (yarn.lock) to learn the specific version of sharp installed, and update the two elastic beanstalk platform scripts to install that specific version. Taking it one step further, you might also advance the script to be able to understand from the lock file which packages need a prebuild stage (and therefore will choke on elastic beanstalk) and add all those packages to the beanstalk platform scripts.

I myself have not implemented anything like this (frankly, I just imagined this when I read your comment), but I sure see how this can be implemented. If you use github to deploy to elastic beanstalk, the same effect can be achieved by using git pre-commit hooks. The node script that I described above can be a pre-commit hook which will make sure that the beanstalk platform scripts are always aligned with the package versions in the lock file.

jeremyisatrecharm commented 1 year ago

@tolgaatam thanks for the reply. That's very discouraging that you don't think AWS will fix. Basically, in my mind, this means AWS Node is broken and if AWS won't fix this, I guess I'd discourage folks from using it. I think your solution is also clever, but I also don't think piling on scripts to fix ...basic npm use... should be the solution here. Amazon should just fix their beanstalk deploy situation or we should use another solution from the provider that cares about their users (Render was neat but I needed a higher level of customization).

pebble-hash commented 1 year ago

Feb 2023, and AWS has still not fixed this issue

lovell commented 1 year ago

I'm going to lock this issue as it is the responsibility of AWS to fix and improve their own systems.

For anyone visiting with problems relating to Elastic Beanstalk due to npm v8 dropping root/sudo privileges when running scripts, the "solution" is in https://github.com/lovell/sharp/issues/3221#issuecomment-1126528844