Hi All,
I am trying to automate nodebb bring-up. I am using Amazon's EC2 with linux2.
Per the manual, my systemctl is as follows:
[Unit]
Description=NodeBB Service
After=system.slice multi-user.target mongod.service
After=syslog.target
[Service]
Type=simple
User=nodebb
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nodebb
Environment=NODE_ENV=production
WorkingDirectory=/home/nodebb/www/nodebb
ExecStart=/usr/bin/env node loader.js --no-silent --no-daemon
Restart=always
[Install]
WantedBy=multi-user.target
My first issue was that node was not found (the recommended nodejs setup is per-user and not global). I solved that by adding a link (ln -s) from the www directory to the latest node version, replacing the ExecStart with:
ExecStart=/usr/bin/env /home/nodebb/www/node_link loader.js --no-silent --no-daemon
NodeBB does start, however, it looks like the WorkingDirectory is not respected, as I am getting spawn npm ENOENT when attempting to install a plugin.
Any idea how to fix this?
Thanks!
JJ.