samedi 30 mai 2015

Trouble setting up a Loopback production host on AWS EC2

I'm having trouble setting up a StrongLoop LoopBack production host on AWS EC2. I'm following these directions.

This is what I tried. I created an EC2 server that's a Ubuntu Server 14.04 LTS. Then I:

$ ssh -i ~/mykey.pem ubuntu@[ec2-ip-address]
$ sudo apt-get update
$ sudo apt-get install build-essential
$ curl -o- http://ift.tt/1HCBTdk | bash
$ nvm install v0.12.4
$ nvm alias default 0.12.4
$ npm install -g strong-pm

$ sudo sl-pm-install
sudo: sl-pm-install: command not found

$ sl-pm-install
Error adding user strong-pm:
useradd: Permission denied.
useradd: cannot lock /etc/passwd; try again later.
Error installing service 'undefined': Command failed: /usr/sbin/useradd --home /var/lib/strong-pm --shell /bin/false --skel /dev/null --create-home --user-group --system strong-pm
useradd: Permission denied.
useradd: cannot lock /etc/passwd; try again later.

As you can see, I cannot install the standalone StrongLoop Process Manager module as "ubuntu" or by using "sudo." This made me wonder if I should be installing everything as root, but I ran into trouble with this approach as well:

$ sudo su
# curl -o- http://ift.tt/1HCBTdk | bash
# nvm install v0.12.4
# nvm alias default 0.12.4

When tring to install the standalone StrongLoop Process Manager module as root, I got the following error:

# npm install -g strong-pm
> heapdump@0.3.5 install /root/.nvm/versions/node/v0.12.4/lib/node_modules/strong-pm/node_modules/strong-runner/node_modules/strong-supervisor/node_modules/heapdump
> node-gyp rebuild

sh: 1: node-gyp: Permission denied
npm WARN optional dep failed, continuing heapdump@0.3.5

> strong-fork-syslog@1.2.3 install /root/.nvm/versions/node/v0.12.4/lib/node_modules/strong-pm/node_modules/strong-runner/node_modules/strong-supervisor/node_modules/strong-fork-syslog
> node-gyp rebuild

sh: 1: node-gyp: Permission denied
npm WARN optional dep failed, continuing strong-fork-syslog@1.2.3

> strong-agent@1.5.1 install /root/.nvm/versions/node/v0.12.4/lib/node_modules/strong-pm/node_modules/strong-runner/node_modules/strong-supervisor/node_modules/strong-agent
> node-gyp rebuild || exit 0

sh: 1: node-gyp: Permission denied
/
> sqlite3@3.0.8 install /root/.nvm/versions/node/v0.12.4/lib/node_modules/strong-pm/node_modules/strong-mesh-models/node_modules/minkelite/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

sh: 1: node-pre-gyp: Permission denied
npm ERR! Linux 3.13.0-48-generic
npm ERR! argv "/root/.nvm/versions/node/v0.12.4/bin/node" "/root/.nvm/versions/node/v0.12.4/bin/npm" "install" "-g" "strong-pm"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! sqlite3@3.0.8 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the sqlite3@3.0.8 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the sqlite3 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 their info via:
npm ERR!     npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/npm-debug.log

What's a proper way to set up a StrongLoop LoopBack production host on AWS EC2? How's it done?




Aucun commentaire:

Enregistrer un commentaire