Unable to pass private key as an environment variable in AWS EB - amazon-ec2

I have been trying to add a private key into the eb environment variable configuration and have tried removing the newline, changing the ("") to ('') but neither of which would be accepted by eb and causes the environment health to be degraded.
I have referenced other questions asked on the platform but most of them uses the export function or are able to get the key saved as an environment variable but unable to retrieve it in the code (How to set multiline RSA private key environment variable for AWS Elastic Beans)
I have added the last 100 lines of logs from eb below as a reference
-------------------------------------
/var/log/nodejs/nodejs.log
-------------------------------------
> webrtc-chatter#0.0.1 start /var/app/current
> node index.js
-------------------------------------
/var/log/nodejs/npm-debug.log
-------------------------------------
UTC 2018/12/28 09:55:31 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/28 13:22:14 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/31 10:03:31 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/31 13:10:09 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/31 13:19:10 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/31 13:21:04 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/31 13:34:08 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/31 13:41:11 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/31 14:02:34 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
UTC 2018/12/31 19:09:33 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log
-------------------------------------
/var/log/eb-activity.log
-------------------------------------
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node /opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.16.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.16.1 install 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/2018-12-31T19_09_33_684Z-debug.log
Not using a reverse proxy
Running npm install: /opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm with --production flag
Failed to run npm install. Snapshot logs for more details.
UTC 2018/12/31 19:09:33 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.13.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
> grpc#1.16.1 install /tmp/deployment/application/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for grpc#1.16.1 and node#10.13.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/tmp/deployment/application/node_modules/grpc/src/node'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/tmp/deployment/application/node_modules/grpc/build'
gyp ERR! System Linux 4.14.77-69.57.amzn1.x86_64
gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /tmp/deployment/application/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node /opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/tmp/deployment/application/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Linux 4.14.77-69.57.amzn1.x86_64
node-pre-gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node" "/tmp/deployment/application/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /tmp/deployment/application/node_modules/grpc
node-pre-gyp ERR! node -v v10.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node /opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.16.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.16.1 install 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/2018-12-31T19_09_33_684Z-debug.log
Not using a reverse proxy
Running npm install: /opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm with --production flag
Failed to run npm install. Snapshot logs for more details.
UTC 2018/12/31 19:09:33 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.13.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)
[2018-12-31T19:09:33.710Z] INFO [18640] - [Configuration update travis-5b0a4d4df0abae1daa0ab1e5fa92b27a5e51021a-1544498766#21/ConfigDeployStage0/ConfigDeployPreHook/50npm.sh] : Activity failed.
[2018-12-31T19:09:33.710Z] INFO [18640] - [Configuration update travis-5b0a4d4df0abae1daa0ab1e5fa92b27a5e51021a-1544498766#21/ConfigDeployStage0/ConfigDeployPreHook] : Activity failed.
[2018-12-31T19:09:33.710Z] INFO [18640] - [Configuration update travis-5b0a4d4df0abae1daa0ab1e5fa92b27a5e51021a-1544498766#21/ConfigDeployStage0] : Activity failed.
[2018-12-31T19:09:33.710Z] INFO [18640] - [Configuration update travis-5b0a4d4df0abae1daa0ab1e5fa92b27a5e51021a-1544498766#21] : Completed activity. Result:
Configuration update - Command CMD-ConfigDeploy failed
[2018-12-31T19:19:07.258Z] INFO [19138] - [CMD-TailLogs] : Starting activity...
[2018-12-31T19:19:07.259Z] INFO [19138] - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2018-12-31T19:19:07.259Z] INFO [19138] - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2018-12-31T19:19:07.259Z] INFO [19138] - [CMD-TailLogs/TailLogs] : Starting activity...
[2018-12-31T19:19:07.259Z] INFO [19138] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...
-------------------------------------
/var/log/eb-commandprocessor.log
-------------------------------------
UTC 2018/12/31 19:09:33 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.13.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install
> grpc#1.16.1 install /tmp/deployment/application/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for grpc#1.16.1 and node#10.13.0 (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/tmp/deployment/application/node_modules/grpc/src/node'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/tmp/deployment/application/node_modules/grpc/build'
gyp ERR! System Linux 4.14.77-69.57.amzn1.x86_64
gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /tmp/deployment/application/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node /opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/tmp/deployment/application/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Linux 4.14.77-69.57.amzn1.x86_64
node-pre-gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node" "/tmp/deployment/application/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /tmp/deployment/application/node_modules/grpc
node-pre-gyp ERR! node -v v10.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/node /opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/tmp/deployment/application/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.16.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.16.1 install 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/2018-12-31T19_09_33_684Z-debug.log
Not using a reverse proxy
Running npm install: /opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm with --production flag
Failed to run npm install. Snapshot logs for more details.
UTC 2018/12/31 19:09:33 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.13.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)
[2018-12-31T19:09:33.710Z] ERROR [18640] : Command CMD-ConfigDeploy failed!
[2018-12-31T19:09:33.711Z] INFO [18640] : Command processor returning results:
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"(TRUNCATED)...opt/elasticbeanstalk/containerfiles/ebnode.py\", line 180, in npm_install\n raise e\nsubprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v10.13.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1. \nHook /opt/elasticbeanstalk/hooks/configdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":1,"events":[{"msg":"Failed to run npm install. Snapshot logs for more details.","severity":"ERROR","timestamp":1546283373711}]}],"truncated":"true"}
[2018-12-31T19:19:07.253Z] DEBUG [19138] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2018-12-31T19:19:07.253Z] DEBUG [19138] : Checking if the command processor should execute...
[2018-12-31T19:19:07.255Z] DEBUG [19138] : Checking whether the command is applicable to instance (i-088e05e1a293a85a2)..
[2018-12-31T19:19:07.255Z] INFO [19138] : Command is applicable to this instance (i-088e05e1a293a85a2)..
[2018-12-31T19:19:07.255Z] DEBUG [19138] : Checking if the received command stage is valid..
[2018-12-31T19:19:07.255Z] INFO [19138] : No stage_num in command. Valid stage..
[2018-12-31T19:19:07.255Z] INFO [19138] : Received command CMD-TailLogs: {"execution_data"=>"*", "instance_ids"=>["i-088e05e1a293a85a2"], "data"=>"f08833bc-0d30-11e9-b16c-2bf0c81d1d06", "command_name"=>"CMD-TailLogs", "api_version"=>"1.0", "resource_name"=>"AWSEBAutoScalingGroup", "request_id"=>"f08833bc-0d30-11e9-b16c-2bf0c81d1d06"}
[2018-12-31T19:19:07.255Z] INFO [19138] : Command processor should execute command.
[2018-12-31T19:19:07.255Z] DEBUG [19138] : Storing current stage..
[2018-12-31T19:19:07.255Z] DEBUG [19138] : Stage_num does not exist. Not saving null stage. Returning..
[2018-12-31T19:19:07.255Z] DEBUG [19138] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2018-12-31T19:19:07.256Z] DEBUG [19138] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands..
[2018-12-31T19:19:07.256Z] DEBUG [19138] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands..
[2018-12-31T19:19:07.257Z] INFO [19138] : Found enabled addons: ["logpublish", "logstreaming"].
[2018-12-31T19:19:07.258Z] INFO [19138] : Updating Command definition of addon logpublish.
[2018-12-31T19:19:07.258Z] INFO [19138] : Updating Command definition of addon logstreaming.
[2018-12-31T19:19:07.258Z] DEBUG [19138] : Loaded definition of Command CMD-TailLogs.
[2018-12-31T19:19:07.258Z] INFO [19138] : Executing CMD-TailLogs
[2018-12-31T19:19:07.259Z] INFO [19138] : Executing command: CMD-TailLogs...
[2018-12-31T19:19:07.259Z] INFO [19138] : Executing command CMD-TailLogs activities...
[2018-12-31T19:19:07.259Z] DEBUG [19138] : Setting environment variables..
[2018-12-31T19:19:07.259Z] INFO [19138] : Running AddonsBefore for command CMD-TailLogs...
[2018-12-31T19:19:07.259Z] DEBUG [19138] : Running stages of Command CMD-TailLogs from stage 0 to stage 0...
[2018-12-31T19:19:07.259Z] INFO [19138] : Running stage 0 of command CMD-TailLogs...
[2018-12-31T19:19:07.259Z] DEBUG [19138] : Loaded 1 actions for stage 0.
[2018-12-31T19:19:07.259Z] INFO [19138] : Running 1 of 1 actions: TailLogs...
Would greatly appreciate if anyone knows a fix for this.
AWS Elastic Beanstalk has finally deployed my application but still has the permission denied from accessing tmp file
Error: EACCES: permission denied, open '/tmp/firebaseadminsdk.json'
Followed exactly the documentation from AWS on storing Private Keys Securely in AWS S3.
Proceeded to create a S3 bucket without changing any permission during the creation. Bucket -> Permission -> Access Control List, checked if the canonical ID matches my IAM account and allow read access. The bucket still doesn't want to be read which I had to go into bucket policy and create a new policy using AWS Policy Generator.
Referenced from this Elastic Beanstalk S3 access via ebextensions.
Also had issues with node-gyp fails due to permission denied which I followed this https://stackoverflow.com/a/46001517/10638194.
I have also added 2 more .ebextensions which I feel one might not be needed
00_dir_permission.config
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/00_set_tmp_permissions.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
chown -R ec2-user /tmp
chown -R $USER:$(id -gn $USER) /tmp/.config
chown -R nodejs:nodejs /tmp/.npm
00_change_npm_permissions.config
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/00_set_tmp_permissions.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
chown -R nodejs:nodejs /tmp/.npm
For the second config file I changed the path from /tmp/npm. to just /tmp/ which was the file that finally allowed my application to deploy but it looks like the same as the first config file, only difference being one is before deployment while the other is after deployment.

Here is an example of securely downloading a .json file from S3 to your Elastic Beanstalk server. See the AWS documentation for reference. If you use your default elastic beanstalk bucket like in the AWS example, you don't need to worry about setting up permissions on the S3 bucket.
Here is the documentation for the file and container_commands directives. In this example, you are downloading the firebase config file to the /etc/pki/tls/certs/ directory. You can modify this location as needed.
# .ebextensions/firebase.config
# Make sure to update the bucket policy on the S3 bucket to
# allow access by the aws-elasticbeanstalk-ec2-role
Resources:
AWSEBAutoScalingGroup:
Metadata:
AWS::CloudFormation::Authentication:
S3Auth:
type: "s3"
buckets: ["my-bucket"]
roleName:
"Fn::GetOptionSetting":
Namespace: "aws:autoscaling:launchconfiguration"
OptionName: "IamInstanceProfile"
DefaultValue: "aws-elasticbeanstalk-ec2-role"
files:
"/etc/pki/tls/certs/firebaseadminsdk.json":
mode: "000400"
owner: nodejs
group: nodejs
authentication: "S3Auth"
source: https://s3-us-west-1.amazonaws.com/my-bucket/firebase-adminsdk-abcde-fghijklmn.json

Related

NativeScript tns create fails - At POSTINSTALL Script

I try to create a new project with the following command, the folders first get created and by the end gets deleted. The project is NOT created finally. I just see a package-lock.json at the end
I'm editing this post with a pattern I've recently been seeing.
Just for a Change I tried doing TNS CREATE with VUE JS, it fails exactly in the POSTINSTALL JS script.
Any idea what I can do to get rid of this issue. This has been wasting my time for over 2 days now.
Here is the log
EDIT --- NEW LOG WITH Node Version 10
Eshcols-iMac:NativeScript eshcol$ sudo tns create
Let’s create a NativeScript app!
Answer the following questions to help us build the right app for you. (Note: you
can skip this prompt next time using the --template option, or the --ng, --vue, --ts,
or --js flags.)
? First, what will be the name of your app? TestApp
? Next, which style of NativeScript project would you like to use: Angular
? Finally, which template would you like to start from: Hello World
fsevents#1.2.7 install /Users/eshcol/NativeScript/TestApp/node_modules/fsevents
node install
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents#1.2.7 and node#10.15.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/build'
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node#10/10.15.0/bin/node" "/usr/local/Cellar/node#10/10.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /Users/eshcol/NativeScript/TestApp/node_modules/fsevents
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node#10/10.15.0/bin/node /usr/local/Cellar/node#10/10.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess. (/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node#10/10.15.0/bin/node" "/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/eshcol/NativeScript/TestApp/node_modules/fsevents
node-pre-gyp ERR! node -v v10.15.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node#10/10.15.0/bin/node /usr/local/Cellar/node#10/10.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/eshcol/NativeScript/TestApp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
nativescript-angular#7.1.2 postinstall /Users/eshcol/NativeScript/TestApp/node_modules/nativescript-angular
node postinstall.js
fs.js:115
throw err;
^
Error: EACCES: permission denied, mkdir '/Users/eshcol/NativeScript/TestApp/hooks'
at Object.mkdirSync (fs.js:753:3)
at Object. (/Users/eshcol/NativeScript/TestApp/node_modules/nativescript-angular/postinstall.js:11:12)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 install: node install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nativescript-angular#7.1.2 postinstall: node postinstall.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nativescript-angular#7.1.2 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! /Users/eshcol/.npm/_logs/2019-02-02T15_47_24_931Z-debug.log
Command npm failed with exit code 1
tns create
To fix project creation in general you can try sudo chown -R username /home/username/.npm This should allow you to run tns create MyApp without adding sudo.

installing Terminalizer using npm on OSX

I am trying to install terminalizer on OSX using npm but I get error with and without using sudo. Not sure how I can proceed with fixing it and installing it successfully:
$ npm install -g terminalizer
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mona/.npm/_logs/2018-12-22T21_48_44_353Z-debug.log
Monas-MacBook-Pro:NotebooksforMLReview mona$ sudo npm install -g terminalizer
Password:
/usr/local/bin/terminalizer -> /usr/local/lib/node_modules/terminalizer/bin/app.js
> node-pty-prebuilt#0.7.6 install /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
> prebuild-install || node scripts/install.js
prebuild-install WARN install EACCES: permission denied, access '/Users/mona/.npm'
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/mona/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--build_v8_with_gn=false"
gyp ERR! cwd /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-pty-prebuilt#0.7.6 install: `prebuild-install || node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-pty-prebuilt#0.7.6 install 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! /Users/mona/.npm/_logs/2018-12-22T21_49_13_893Z-debug.log
Monas-MacBook-Pro:NotebooksforMLReview mona$ vi /Users/mona/.npm/_logs/2018-12-22T21_49_13_893Z-debug.log
I have the following:
$ uname -a
Darwin Monas-MacBook-Pro.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:59:54 PDT 2018; root:xnu-4570.71.2~2/RELEASE_X86_64 x86_64
$ npm -v
6.4.1
and the last 100 lines of the log:
$ tail -100 /Users/mona/.npm/_logs/2018-12-22T21_49_13_893Z-debug.log
6955 info lifecycle tar-stream#1.6.2~install: tar-stream#1.6.2
6956 silly install inflight#1.0.6
6957 info lifecycle inflight#1.0.6~install: inflight#1.0.6
6958 silly install glob#7.1.3
6959 info lifecycle glob#7.1.3~install: glob#7.1.3
6960 silly install rimraf#2.6.2
6961 info lifecycle rimraf#2.6.2~install: rimraf#2.6.2
6962 silly install fs-extra#0.30.0
6963 info lifecycle fs-extra#0.30.0~install: fs-extra#0.30.0
6964 silly install pump#2.0.1
6965 info lifecycle pump#2.0.1~install: pump#2.0.1
6966 silly install simple-get#2.8.1
6967 info lifecycle simple-get#2.8.1~install: simple-get#2.8.1
6968 silly install pump#1.0.3
6969 info lifecycle pump#1.0.3~install: pump#1.0.3
6970 silly install tar-fs#1.16.3
6971 info lifecycle tar-fs#1.16.3~install: tar-fs#1.16.3
6972 silly install prebuild-install#5.2.2
6973 info lifecycle prebuild-install#5.2.2~install: prebuild-install#5.2.2
6974 silly install xtend#2.1.2
6975 info lifecycle xtend#2.1.2~install: xtend#2.1.2
6976 silly install through2#0.2.3
6977 info lifecycle through2#0.2.3~install: through2#0.2.3
6978 silly install progress-stream#1.2.0
6979 info lifecycle progress-stream#1.2.0~install: progress-stream#1.2.0
6980 silly install nugget#2.0.1
6981 info lifecycle nugget#2.0.1~install: nugget#2.0.1
6982 silly install electron-download#3.3.0
6983 info lifecycle electron-download#3.3.0~install: electron-download#3.3.0
6984 silly install y18n#4.0.0
6985 info lifecycle y18n#4.0.0~install: y18n#4.0.0
6986 silly install camelcase#5.0.0
6987 info lifecycle camelcase#5.0.0~install: camelcase#5.0.0
6988 silly install yargs-parser#11.1.1
6989 info lifecycle yargs-parser#11.1.1~install: yargs-parser#11.1.1
6990 silly install ansi-regex#3.0.0
6991 info lifecycle ansi-regex#3.0.0~install: ansi-regex#3.0.0
6992 silly install find-up#3.0.0
6993 info lifecycle find-up#3.0.0~install: find-up#3.0.0
6994 silly install is-fullwidth-code-point#2.0.0
6995 info lifecycle is-fullwidth-code-point#2.0.0~install: is-fullwidth-code-point#2.0.0
6996 silly install strip-ansi#4.0.0
6997 info lifecycle strip-ansi#4.0.0~install: strip-ansi#4.0.0
6998 silly install string-width#2.1.1
6999 info lifecycle string-width#2.1.1~install: string-width#2.1.1
7000 silly install yauzl#2.4.1
7001 info lifecycle yauzl#2.4.1~install: yauzl#2.4.1
7002 silly install extract-zip#1.6.7
7003 info lifecycle extract-zip#1.6.7~install: extract-zip#1.6.7
7004 silly install async-promises#0.2.1
7005 info lifecycle async-promises#0.2.1~install: async-promises#0.2.1
7006 silly install death#1.1.0
7007 info lifecycle death#1.1.0~install: death#1.1.0
7008 silly install deepmerge#2.2.1
7009 info lifecycle deepmerge#2.2.1~install: deepmerge#2.2.1
7010 silly install electron#2.0.16
7011 info lifecycle electron#2.0.16~install: electron#2.0.16
7012 silly install flowa#4.0.2
7013 info lifecycle flowa#4.0.2~install: flowa#4.0.2
7014 silly install fs-extra#5.0.0
7015 info lifecycle fs-extra#5.0.0~install: fs-extra#5.0.0
7016 silly install gif-encoder#0.6.1
7017 info lifecycle gif-encoder#0.6.1~install: gif-encoder#0.6.1
7018 silly install inquirer#6.2.1
7019 info lifecycle inquirer#6.2.1~install: inquirer#6.2.1
7020 silly install js-yaml#3.12.0
7021 info lifecycle js-yaml#3.12.0~install: js-yaml#3.12.0
7022 silly install node-pty-prebuilt#0.7.6
7023 info lifecycle node-pty-prebuilt#0.7.6~install: node-pty-prebuilt#0.7.6
7024 verbose lifecycle node-pty-prebuilt#0.7.6~install: unsafe-perm in lifecycle false
7025 verbose lifecycle node-pty-prebuilt#0.7.6~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/node_modules/.bin:/usr/local/lib/node_modules/terminalizer/node_modules/.bin:/usr/local/lib/node_modules/.bin:/Users/mona/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
7026 verbose lifecycle node-pty-prebuilt#0.7.6~install: CWD: /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
7027 silly lifecycle node-pty-prebuilt#0.7.6~install: Args: [ '-c', 'prebuild-install || node scripts/install.js' ]
7028 silly lifecycle node-pty-prebuilt#0.7.6~install: Returned: code: 1 signal: null
7029 info lifecycle node-pty-prebuilt#0.7.6~install: Failed to exec install script
7030 timing action:install Completed in 627ms
7031 verbose unlock done using /Users/mona/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
7032 timing stage:rollbackFailedOptional Completed in 922ms
7033 timing stage:runTopLevelLifecycles Completed in 11566ms
7034 verbose stack Error: node-pty-prebuilt#0.7.6 install: `prebuild-install || node scripts/install.js`
7034 verbose stack Exit status 1
7034 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
7034 verbose stack at EventEmitter.emit (events.js:182:13)
7034 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
7034 verbose stack at ChildProcess.emit (events.js:182:13)
7034 verbose stack at maybeClose (internal/child_process.js:962:16)
7034 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
7035 verbose pkgid node-pty-prebuilt#0.7.6
7036 verbose cwd /Users/mona/machine learning/NotebooksforMLReview
7037 verbose Darwin 17.7.0
7038 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "terminalizer"
7039 verbose node v10.14.2
7040 verbose npm v6.4.1
7041 error code ELIFECYCLE
7042 error errno 1
7043 error node-pty-prebuilt#0.7.6 install: `prebuild-install || node scripts/install.js`
7043 error Exit status 1
7044 error Failed at the node-pty-prebuilt#0.7.6 install script.
7044 error This is probably not a problem with npm. There is likely additional logging output above.
7045 verbose exit [ 1, true ]
The following installed the Terminalizer (adding the --unsafe-perm flag) (please pitch in if there's a better solution. I am no expert in npm):
$ sudo npm install --unsafe-perm -g terminalizer
Password:
/usr/local/bin/terminalizer -> /usr/local/lib/node_modules/terminalizer/bin/app.js
> node-pty-prebuilt#0.7.6 install /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
> prebuild-install || node scripts/install.js
> electron#2.0.16 postinstall /usr/local/lib/node_modules/terminalizer/node_modules/electron
> node install.js
Downloading SHASUMS256.txt
[============================================>] 100.0% of 5.39 kB (5.39 kB/s)
> node-pty-prebuilt#0.7.6 postinstall /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
> node scripts/post-install.js
+ terminalizer#0.6.0
added 292 packages from 214 contributors in 40.879s

failed to install composer-cli but I see errors

I see the following errors when run command npm install -g composer-cli#0.20
nvm 0.33.0
npm 6.4.1
node 10.13.0
I'm trying to the Hyperledger in my local Mac OS
but it keep failing when I run the command.
I followed this guide to install it
https://hyperledger.github.io/composer/latest/installing/development-tools.html
here's the error part:
grpc#1.10.1 install /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v64-darwin-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc#1.10.1 and node#10.13.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Pre-built binaries not installable for grpc#1.10.1 and node#10.13.0 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
sed: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
rm: ./Release/.deps/Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o.d.raw: No such file or directory
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/jason/.nvm/versions/node/v10.13.0/bin/node /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Darwin 17.4.0
node-pre-gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
node-pre-gyp ERR! node -v v10.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok
Failed to execute '/Users/jason/.nvm/versions/node/v10.13.0/bin/node /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown' (1)
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.oe
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
In file included from ../deps/grpc/src/core/lib/channel/channel_stack_builder.cc:19:
In file included from ../deps/grpc/src/core/lib/channel/channel_stack_builder.h:24:
../deps/grpc/src/core/lib/channel/channel_args.h:22:10: fatal error:
'grpc/compression.h' file not found
#include <grpc/compression.h>
^~~~~~~~~~~~~~~~~~~~
1 error generated.░⸩ ⠏ install: info lifecycle grpc#1.10.1~install: Failed to e
make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o] Error 1
gyp ERR! build error ⠏ install: info lifecycle grpc#1.10.1~install: Failed to e
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 17.4.0
gyp ERR! command "/Users/jason/.nvm/versions/node/v10.13.0/bin/node" "/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/extension_binary/node-v64-darwin-x64-unknown"
gyp ERR! cwd /Users/jason/.nvm/versions/node/v10.13.0/lib/node_modules/composer-cli/node_modules/grpc
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc#1.10.1 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc#1.10.1 install 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! /Users/jason/.npm/_logs/2018-10-31T02_08_58_962Z-debug.log
This is because node has just released node 10 as lts and the prereqs-ubuntu.sh script installs the lts version of node so you are now getting node 10.
It's easy to fix, just before installing composer just run the following commands
nvm install 8
nvm use 8
this will install node 8 and then you are ready to install composer.
This error occurs due to incompatibility of node version. You have to downgrade your node version to 8.x.x.
Just follow the steps written below:
First search for your desired package:
brew search node
This will give you the follow results:
leafnode node node#6 nodebrew
libbitcoin-node node-build node#8 nodeenv
llnode node#10 ✔ node_exporter nodenv
....
And then install the desired version:
brew install node#8
Also remember that you can install more than 1 node package at the same time, but you cannot have them available at the same time. So if you have the latest/generic node package already installed you need to unlink it first:
brew unlink node
And then you can link a different version:
brew link node#8
Now you can install composer-cli.
Note: Run the composer-tools installation commands without sudo or
root.

configure: error: C compiler cannot create executables mac

I am trying to install ccxt on my Macbook Air using sudo npm install --save ccxt and encountered the following error:
> scrypt#6.0.3 preinstall /Applications/Xcode.app/Contents/Developer/Toolchains/node_modules/scrypt
> node node-scrypt-preinstall.js
Error: Error: Command failed: ./configure
configure: error: in `/Applications/Xcode.app/Contents/Developer/Toolchains/node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
> scrypt#6.0.3 install /Applications/Xcode.app/Contents/Developer/Toolchains/node_modules/scrypt
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/peterpham/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:275:12)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack at emitOne (events.js:116:13)
gyp ERR! stack at Socket.emit (events.js:211:7)
gyp ERR! stack at Pipe._handle.close [as _onclose] (net.js:557:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Applications/Xcode.app/Contents/Developer/Toolchains/node_modules/scrypt
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Applications/Xcode.app/Contents/Developer/Toolchains/package.json'
npm WARN Toolchains No description
npm WARN Toolchains No repository field.
npm WARN Toolchains No README data
npm WARN Toolchains No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt#6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt#6.0.3 install 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! /Users/peterpham/.npm/_logs/2018-08-30T04_34_20_141Z-debug.log
I have Xcode 9.4.1 installed and checked that my command line tools were installed in the Preferences > Location section like in this other stackoverflow question. I also tried out all of the following answers in my terminal to change directories and ownerships to no avail. Also tried just sudo npm install --save scrypt with the same error. It has possibly something to do with the anaconda env pathing.
I'm pretty sure it has to do with some configuration but I'm not sure what it is. If you need anymore information please tell me and I'll post it. I don't know where the configure.log is so I can't post it, I've tried to find it using resources online as well and am lost.
The key to solving the error was this part of the error code:
gyp ERR! stack Error: Command failed: /Users/peterpham/anaconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
So I tried installing python 2.7, which didn't work. So I tried uninstalling Anaconda from my computer using App Cleaner and that did the trick. Afterwards I could run the command npm install --save ccxt!

Yeoman Meanjs generator unable to get local issuer certificate

The company I work for uses a Zscaler proxy and I am trying to get the meanjs yeoman generator to work on my Windows 10 machine. So far I have managed to get npm to work by setting the proxy, https-proxy and the registry as follows:
npm config set proxy http://gateway.zscalerone.net/80
npm config set https-proxy http://gateway.zscalerone.net/80
npm config set registry http://registry.npmjs.org/
however when I run:
yo meanjs
I get the following:
Running npm install for you....
This may take a couple minutes.
Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "cd mean && npm install"
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs#2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated jade#0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated graceful-fs#3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated lodash#1.0.2: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^4.0.0.
npm WARN deprecated minimatch#1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global node-gyp#3.3.1 should be installed with -g
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
gyp ERR! stack at emitNone (events.js:67:13)
gyp ERR! stack at TLSSocket.emit (events.js:166:7)
gyp ERR! stack at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
gyp ERR! stack at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ShaneH\\AppData\\Roaming\\nvm\\v4.4.5\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ShaneH\Code\temp\mean\node_modules\bufferutil
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN install:bufferutil#1.2.1 bufferutil#1.2.1 install: `node-gyp rebuild`
npm WARN install:bufferutil#1.2.1 Exit status 1
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
gyp ERR! stack at emitNone (events.js:67:13)
gyp ERR! stack at TLSSocket.emit (events.js:166:7)
gyp ERR! stack at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
gyp ERR! stack at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ShaneH\\AppData\\Roaming\\nvm\\v4.4.5\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\ShaneH\Code\temp\mean\node_modules\utf-8-validate
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN install:utf-8-validate#1.2.1 utf-8-validate#1.2.1 install: `node-gyp rebuild`
npm WARN install:utf-8-validate#1.2.1 Exit status 1
node-pre-gyp ERR! Tried to download: https://node-inspector.s3.amazonaws.com/debug/v0.7.7/node-v46-win32-ia32.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for v8-debug#0.7.7 and node#4.4.5 (node-v46 ABI) (falling back to source compile with node-gyp)
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket.<anonymous> (_tls_wrap.js:1017:38)
gyp ERR! stack at emitNone (events.js:67:13)
gyp ERR! stack at TLSSocket.emit (events.js:166:7)
gyp ERR! stack at TLSSocket._init.ssl.onclienthello.ssl.oncertcb.TLSSocket._finishInit (_tls_wrap.js:582:8)
gyp ERR! stack at TLSWrap.ssl.onclienthello.ssl.oncertcb.ssl.onnewsession.ssl.onhandshakedone (_tls_wrap.js:424:38)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ShaneH\\Code\\temp\\mean\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\ShaneH\\Code\\temp\\mean\\node_modules\\v8-debug\\build\\debug\\v0.7.7\\node-v46-win32-ia32\\debug.node" "--module_name=debug" "--module_path=C:\\Users\\ShaneH\\Code\\temp\\mean\\node_modules\\v8-debug\\build\\debug\\v0.7.7\\node-v46-win32-ia32" "--msvs_version=2015"
gyp ERR! cwd C:\Users\ShaneH\Code\temp\mean\node_modules\v8-debug
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\ShaneH\Code\temp\mean\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\ShaneH\Code\temp\mean\node_modules\v8-debug\build\debug\v0.7.7\node-v46-win32-ia32\debug.node --module_name=debug --module_path=C:\Users\ShaneH\Code\temp\mean\node_modules\v8-debug\build\debug\v0.7.7\node-v46-win32-ia32 --msvs_version=2015' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\ShaneH\Code\temp\mean\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.10240
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ShaneH\\Code\\temp\\mean\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\ShaneH\Code\temp\mean\node_modules\v8-debug
node-pre-gyp ERR! node -v v4.4.5
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm WARN eslint-config-airbnb#6.0.2 requires a peer of eslint-plugin-react#^4.0.0 but none was installed.
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.5
npm ERR! npm v3.9.6
npm ERR! code ELIFECYCLE
npm ERR! v8-debug#0.7.7 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug#0.7.7 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the v8-debug package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs v8-debug
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls v8-debug
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\ShaneH\Code\temp\mean\npm-debug.log
at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
Which seems to indicate that it can't connect via https to
https://node-inspector.s3.amazonaws.com/debug/v0.7.7/node-v46-win32-ia32.tar.gz
I have tried setting up http_proxy and https_proxy environment variables, but this doesn't seem to have made a difference. I am also able to browse to that URL in a browser without an issue.
I assume the error has to do with the way Zscaler is handling https. Any help would be greatly appreciated.

Resources