Hey guys! I hope to find some help here even though this room didn't seem to have much life in last 5 months or so :) I'm trying to run a node script on a service startup (Ubuntu 12.04): it's been running alright this way before I started using nvm:
exec sudo -u strider <script>
Unfortunately, it seems that $PATH is the one of a root user when the command is run like this meaning that bash sees neither the script nor the node executable.
I feel so stupid right now, as it seems like an issue that must've already been solved so many times, but I still can't get it working as well finding anything helpful on the matter. Maybe someone can point me at how it can be done?
bash -l -c 'source ~/.nvm/nvm.sh; nvm install; npm install; npm run build'
@charginghawk I am using this currently in my dockerfile:<code> ENV NVM_DIR /root/.nvm
ENV NODE_VERSION 8
#7
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& npm install http-server </code>
nvm ls | grep -e 'default -> v8.9.3'
v8.9.3
set as the default right now)
➜ nvm ls
v8.9.3
default -> v8.9.3
node -> stable (-> v8.9.3) (default)
stable -> 8.9 (-> v8.9.3) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.9.3)
lts/argon -> v4.8.7 (-> N/A)
lts/boron -> v6.12.2 (-> N/A)
lts/carbon -> v8.9.3
TERM=dumb nvm alias default
Readme.md
want a PR?
nvm alias x
prints out what "x" is :-)
nvm --help
should also probably say those things if it doesn't already