Skip to content
Advertisement

Installing nvm on bash on ubunutu on windows 10 throws error

I’m testing the new bash on ubuntu on windows 10 and the first thing I tried to do is to install node. Of course, since I now have a “Linux system” I went ahead and installed nvm.

I also had to

apt-get make gcc g++

One done i tried

nvm install v4.4.2

but I got:

make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/root/.nvm/src/node-v4.4.2/out'
g++ -pthread -rdynamic -m64 -fuse-ld=gold -B/root/.nvm/src/node-
v4.4.2/third_party/binutils/Linux_x64/Release/bin -m64  -o /root/.nvm/src/node-v4.4.2/out/Release/mksnapshot -Wl,--start-group /root/.nvm/src/node-v4.4.2/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/mksnapshot.o /root/.nvm/src/node-v4.4.2/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a /root/.nvm/src/node-v4.4.2/out/Release/obj.target/deps/v8/tools/gyp/libv8_nosnapshot.a /root/.nvm/src/node-v4.4.2/out/Release/obj.target/deps/v8/tools/gyp/libv8_libplatform.a /root/.nvm/src/node-v4.4.2/out/Release/obj.target/deps/v8/tools/gyp/libv8_libbase.a -Wl,--end-group -ldl -lrt
/usr/bin/ld.gold: fatal error: /root/.nvm/src/node-v4.4.2/out/Release/mksnapshot: Invalid argument
collect2: error: ld returned 1 exit status
make[1]: *** [/root/.nvm/src/node-v4.4.2/out/Release/mksnapshot] Error 1
make[1]: Leaving directory `/root/.nvm/src/node-v4.4.2/out'
make: *** [node] Error 2
nvm: install v4.4.2 failed!

Do you know what’s causing this? I think that I may have something missconfigured on the make command maybe?

NOTE: installing node using the “official way” works, that is:

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs

Advertisement

Answer

I think it’s an issue in the bash subsystem. There are several open issues on github.com relating to installing nvm, rbenv, rvm, as well as creating symlinks.

These two issues appear to be directly related to the problem you’re experiencing. https://github.com/Microsoft/BashOnWindows/issues/6 https://github.com/Microsoft/BashOnWindows/issues/9

Also, FYI, I have attempted to build node 4 and node 5 from source, but fail during the make command with this message:

/usr/bin/ld.gold: fatal error: /root/working/node-v5.10.1/out/Release/mksnapshot: Invalid argument collect2: error: ld returned 1 exit status

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement