aws / aws-lambda-nodejs-runtime-interface-client

Apache License 2.0
180 stars 56 forks source link

postinstall.sh script fails with gyp ERR! stack Error: EACCES: permission denied, unlink 'build/Makefile' #43

Closed anthony-telljohann closed 2 years ago

anthony-telljohann commented 2 years ago

I'm trying to install aws-lambda-ric in my custom centos 7 docker image but while installing dependencies, aws-lambda-ric postinstall.sh script fails with gyp ERR! stack Error: EACCES: permission denied, unlink 'build/Makefile'

install dependencies command

npm ci

logs (some emitted for brevity)

> aws-lambda-ric@2.0.0 postinstall /builddir/node_modules/aws-lambda-ric
> ./scripts/postinstall.sh

npm verb cli [
npm verb cli   '/opt/rh/rh-nodejs14/root/usr/bin/node',
npm verb cli   '/builddir/node_modules/.bin/npm',
npm verb cli   'run',
npm verb cli   'build:gyp'
npm verb cli ]
npm info using npm@8.1.4
npm info using node@v14.17.5
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/builddir/node_modules/npm/npmrc Completed in 1ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 1ms
npm verb config only Use `--omit=dev` to omit dev dependencies from the install.
npm verb config shrinkwrap Use the --package-lock setting instead.
npm verb config cache-max This option has been deprecated in favor of `--prefer-online`
npm verb config auth-type This method of SSO/SAML/OAuth is deprecated and will be removed in
npm verb config a future version of npm in favor of web-based login.
npm verb config optional Use `--omit=optional` to exclude optional dependencies, or
npm verb config `--include=optional` to include them.
npm verb config 
npm verb config     Default value does install optional deps unless otherwise omitted.
npm verb config sso-poll-frequency The --auth-type method of SSO/SAML/OAuth will be removed in a future
npm verb config version of npm in favor of web-based login.
npm verb config sso-type The --auth-type method of SSO/SAML/OAuth will be removed in a future
npm verb config version of npm in favor of web-based login.
npm verb config cache-min This option has been deprecated in favor of `--prefer-offline`.
npm verb config tmp This setting is no longer used.  npm stores temporary files in a special
npm verb config location in the cache, and they are managed by
npm verb config     [`cacache`](http://npm.im/cacache).
npm timing config:load:env Completed in 2ms
npm timing config:load:file:/builddir/node_modules/aws-lambda-ric/.npmrc Completed in 0ms
npm timing config:load:project Completed in 0ms
npm timing config:load:file:/root/.npmrc Completed in 1ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:/opt/rh/rh-nodejs14/root/usr/etc/npmrc Completed in 1ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 2ms
npm timing config:load:credentials Completed in 0ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 10ms
npm timing npm:load:configload Completed in 10ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 1ms
npm timing config:load:flatten Completed in 2ms
npm timing npm:load:cleanupLog Completed in 2ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 0ms
npm timing npm:load Completed in 18ms

> aws-lambda-ric@2.0.0 build:gyp
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/opt/rh/rh-nodejs14/root/usr/bin/node',
gyp verb cli   '/builddir/node_modules/aws-lambda-ric/node_modules/.bin/node-gyp',
gyp verb cli   'rebuild'
gyp verb cli ]
gyp info using node-gyp@8.1.0
gyp info using node@14.17.5 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp ERR! clean error 
gyp ERR! stack Error: EACCES: permission denied, unlink 'build/Makefile'
gyp ERR! System Linux 3.10.0-1160.42.2.el7.x86_64
gyp ERR! command "/opt/rh/rh-nodejs14/root/usr/bin/node" "/builddir/node_modules/aws-lambda-ric/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /builddir/node_modules/aws-lambda-ric
gyp ERR! node -v v14.17.5
gyp ERR! node-gyp -v v8.1.0
gyp ERR! not ok 
npm timing command:run Completed in 94ms
npm verb exit 1
npm timing npm Completed in 219ms
npm verb code 1
npm verb lifecycle aws-lambda-ric@2.0.0~postinstall: unsafe-perm in lifecycle false
npm verb lifecycle aws-lambda-ric@2.0.0~postinstall: PATH: /opt/rh/rh-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/node-gyp-bin:/builddir/node_modules/aws-lambda-ric/node_modules/.bin:/builddir/node_modules/.bin:/opt/rh/rh-nodejs14/root/bin:/opt/rh/git19/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle aws-lambda-ric@2.0.0~postinstall: CWD: /builddir/node_modules/aws-lambda-ric
npm info lifecycle aws-lambda-ric@2.0.0~postinstall: Failed to exec postinstall script
npm verb teardown shutting down workers.
npm info teardown Done in 0s
npm verb stack Error: aws-lambda-ric@2.0.0 postinstall: `./scripts/postinstall.sh`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/opt/rh/rh-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/index.js:332:16)
npm verb stack     at EventEmitter.emit (events.js:400:28)
npm verb stack     at ChildProcess.<anonymous> (/opt/rh/rh-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:400:28)
npm verb stack     at maybeClose (internal/child_process.js:1055:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm verb pkgid aws-lambda-ric@2.0.0
npm verb cwd /builddir
npm verb Linux 3.10.0-1160.42.2.el7.x86_64
npm verb argv "/opt/rh/rh-nodejs14/root/usr/bin/node" "/opt/rh/rh-nodejs14/root/bin/npm" "ci" "--only=production"
npm verb node v14.17.5
npm verb npm  v6.14.14
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aws-lambda-ric@2.0.0 postinstall: `./scripts/postinstall.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the aws-lambda-ric@2.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 119668ms