up vote
down votefavorite
<http://stackoverflow.com/questions/38482674/usr-bin-env-node-permission-denied-for-nodejs-using-aws-code-deploy#>
I wrote a script for deploying code to EC2 instance using AWS Code Deploy,
my files are getting copied to the destination, then my hooks run, remove
commands, cd commands are running fine but when the following command is
run:
/usr/bin/node/bin/forever start /home/ubuntu/codebase/app/bin/www
I get the following error and deployment fails:
/usr/bin/env: node: Permission denied
I have setup the node version v4.4.0 by downloading using wget and then
adding following paths to bashrc:
export NODEJS_HOME=/usr/share/nodejs/binexport PATH=$PATH:$NODEJS_HOME
I also added a symlink:
sudo ln -s /usr/share/nodejs/
My appspec.yml hooks:
ApplicationStart:
- location: scripts/start_server.sh
timeout: 30
runas: ubuntu
Questions:
1. Why am I getting 'node: permission denied' error?
2. Secondly, Why I need to give the full path for 'npm, node, forever'?
If I go to the corresponding directory:
/opt/codedeploy-agent/deployment-root/..... and then run my script manually
as an Ubuntu user, it works fine. Although running it as sudo, gives the
same error on console
--
Disclaimer :-
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to which they are
addressed. If you are not the intended recipient, you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail and destroy all copies of this message and any
attachments. Any views or opinions presented in this email are solely those
of the author and do not necessarily represent those of the company.
Warning: Although the company has taken reasonable precautions to ensure no
viruses are present in this email, the company cannot accept responsibility
for any loss or damage arising from the use of this email or attachments.
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/4dbc84a3-93af-4a9e-95f2-7c5debacad43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.