Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 20:34
    JoshuaVSherman commented #1651
  • Jan 31 20:32
    JoshuaVSherman commented #1651
  • Jan 31 19:42
    bthompson90 commented #1994
  • Jan 30 21:33
    anishmittal2020 commented #1994
  • Jan 29 23:51
    ljharb commented #1994
  • Jan 29 23:51
    anishmittal2020 commented #1994
  • Jan 29 23:49
    anishmittal2020 commented #1994
  • Jan 29 22:05
    Tbhesswebber closed #1997
  • Jan 29 22:05
    Tbhesswebber commented #1997
  • Jan 29 22:03
    ljharb commented #1997
  • Jan 29 22:01
    Tbhesswebber edited #1997
  • Jan 29 21:59
    Tbhesswebber opened #1997
  • Jan 29 18:14
    ljharb labeled #1995
  • Jan 29 18:14
    ljharb labeled #1995
  • Jan 29 18:14
    ljharb labeled #1995
  • Jan 29 18:14
    ljharb commented #1995
  • Jan 29 12:40
    abhishek6262 edited #1996
  • Jan 29 12:39
    abhishek6262 edited #1996
  • Jan 29 12:39
    abhishek6262 opened #1996
  • Jan 29 11:59
    promcoder commented #308
Jordan Harband
@ljharb
(or at least on the last one)
Varun Jayaraman
@varunjayaraman
it should be whatever the npm library ssh2 requests
i'll look inside the source code
but i think i'm just gonna manually configure nvm
that's literally the only part breaking my entire script that allows me to configure my vm with a one-liner and i have to ssh in to configure the ssh keys in .ssh/authorized_keys, it's not too hard to run that one other line to install nvm
Jordan Harband
@ljharb
gotcha
Varun Jayaraman
@varunjayaraman
thanks for all the help though
Jordan Harband
@ljharb
np, good luck
glock18
@glock18

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?

Jordan Harband
@ljharb
@glock18 yes, nvm is per-user, so it's not compatible with sudo
so if you want root to have nvm, it needs its own installation of nvm, and your script probably will need to source nvm.sh
glock18
@glock18
@ljharb thank you for response. No, of course I don't want to run any of this as a root user. For now I'm gonna be passing right PATH to the command, which might be not-to-good of a solution, but at least it doesn't require shenanigans with multiple installations of nvm, node or whatnot.
Jordan Harband
@ljharb
@glock18 makes sense. ideally the script wouldn't need sudo at all tho :-)
Thomas M. Charging Hawk
@charginghawk
howdy
running nvm in a makefile in a docker container,
I've pieced together this command: bash -l -c 'source ~/.nvm/nvm.sh; nvm install; npm install; npm run build'
it gets the job done, but checking for glaring pitfalls my team might run into using this
Jordan Harband
@ljharb
@charginghawk you've now asked in 3 places :-) cross-posting doesn't help much. let's continue in #nvm on freenode.
Filip94
@Filip94
Hello everyone, i tryed the web, but was not able to find anything.
"Using nvm in a Makefile"
doable or no?
and how :)
Jordan Harband
@ljharb
@filip94 i don't see why it's not doable; but nvm works by modifying the PATH, and make tasks don't share the same shell session as the one that make was invoked from
Sam Korn
@sako0938
Anyone know how to select an architecture with NVM? Using a service that cross compiles and wraps up a raspberry pi docker images, and the builder cannot find latest binaries for armv8, so it tries to compile which takes forever. I want to choose armv6

@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>

Jordan Harband
@ljharb
@sako0938 there's no "select an architecture"; if nvm won't install on your arch, and there's no node compiler flags that can make it do so, then your arch isn't supported by node
Sam Korn
@sako0938
My architecture is supported, ended up just not using nvm and including the lts binary for my architecture within my repo. My problem is related to having a different system building the image than actually running it.
Jordan Harband
@ljharb
ah. yeah that's just always going to cause problems
your build machine should always be identical to your production machine, for tons of reasons
William Hetherington
@willwh
hi guys, I have the strangest problem, really perplexed; I'm using something like the following to attempt to check if the current node version is set to what I have in an ansible playbook.....
i.e. this should exit code 0; nvm ls | grep -e 'default -> v8.9.3'
('cause I have 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
anyone have any ideas? I really want this role to be idempotent, and need to figure this, if anyone has any ideas, I'd love to hear 'em ;)
Jordan Harband
@ljharb
@willwh nvm alias default will print it out directly
@willwh however i think the issue might be that terminal colors are messing it up. try TERM=dumb nvm alias default
(that shuts off the colors)
William Hetherington
@willwh
welp, that's pretty awful
thank you so much for the help @ljharb :)
that sorted me right out!
that should probably make it in the Readme.md want a PR?
;)
Jordan Harband
@ljharb
sure, you mean like a general section about terminal colors?
also that nvm alias x prints out what "x" is :-)
nvm --help should also probably say those things if it doesn't already
@willwh a PR would be great :-)
William Hetherington
@willwh
@ljharb groovy, am at work right now, with deadlines, I promise I will crank something out over the weekend though
:)
Jordan Harband
@ljharb
sounds great
William Hetherington
@willwh
thanks so much, again! :)
I made myself a reminder ;) creationix/nvm#1693
jimmy · YIN
@jimmyYSY
hey how to use nvm for windows