0

I am using Codeship as my CI tool, I integrate it with AWS CodeDeploy service. The procedure is perfect until my appspec.yml file calls my script to run the node app. Even though I have npm, node, bower and grunt installed I get command not found errors.

Errors

3 Answers3

0

I would try editing your start_server.sh and adding npm and node to the $PATH environment variable or put that path directly in the command itself.

So instead of npm install

Try /usr/local/bin/npm install

That might not be where your npm lives but if you need to find out just do which npm

enderv
  • 203
  • 1
  • 2
  • 7
0

Perform the below steps:

  1. which node
  2. sudo ln -s /home/ubuntu/.nvm/versions/node/v12.13.1/bin/node (output of above step) /usr/bin/node
  3. which npm
  4. sudo ln -s /home/ubuntu/.nvm/versions/node/v12.13.1/bin/npm (output of above step) /usr/bin/npm

and try to use it via /usr/bin/npm install

I hope this will help you!!

Harsh Patel
  • 446
  • 5
  • 8
0

For people who still might run into the same problem.

Check your appspec.yml file and look at the destination, it should contain something like /home/ec2-user....

in this case we need to make sure code deploy agent runs with that user profile (ec2-user). Check this link for steps to to make code deploy to run with your user profile