-
-
Notifications
You must be signed in to change notification settings - Fork 309
Open
Labels
Description
Beanstalk does not change into the project directory when doing an npm install. The project folder gets passed as an parameter. As patch-package does lookup the package.json in the current directory, the postinstall process fails.
command is:
"/opt/elasticbeanstalk/node-install/node-v10.16.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v10.16.0-linux-x64/bin/npm" "install" "/tmp/deployment/application"
in the logs there is something like this:
[2019-09-06T12:16:05.350Z] INFO [16468] - [Configuration update code-pipeline-1567079712160-nmg2-backend-api-dev-build-8da46fc9-75a1-4e86-989e-21f65f908e20@129/ConfigDeployStage0/ConfigDeployPreHook/50npm.sh] : Starting activity...
[2019-09-06T12:16:17.600Z] INFO [16468] - [Configuration update code-pipeline-1567079712160-nmg2-backend-api-dev-build-8da46fc9-75a1-4e86-989e-21f65f908e20@129/ConfigDeployStage0/ConfigDeployPreHook/50npm.sh] : Activity execution failed, because: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
> backend-api@2.5.6 postinstall /tmp/deployment/application
> patch-package
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module './package.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/tmp/deployment/application/node_modules/.bin/patch-package:4:13)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! backend-api@2.5.6 postinstall: `patch-package`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the backend-api@2.5.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/.npm/_logs/2019-09-06T12_16_17_488Z-debug.log
Running npm install: /opt/elasticbeanstalk/node-install/node-v10.16.0-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm without --production flag
Failed to run npm install. Snapshot logs for more details.
UTC 2019/09/06 12:16:17 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
Traceback (most recent call last):
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in <module>
main()
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
node_version_manager.run_npm_install(options.app_path)
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v10.16.0-linux-x64/bin/npm', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
> backend-api@2.5.6 postinstall /tmp/deployment/application
> patch-package
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module './package.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/tmp/deployment/application/node_modules/.bin/patch-package:4:13)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! backend-api@2.5.6 postinstall: `patch-package`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the backend-api@2.5.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/.npm/_logs/2019-09-06T12_16_17_488Z-debug.log
Running npm install: /opt/elasticbeanstalk/node-install/node-v10.16.0-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm without --production flag
Failed to run npm install. Snapshot logs for more details.
UTC 2019/09/06 12:16:17 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
mattleff