问题
I have installed nodejs 8, I can't run karma tests with angular 1.. As specified on Karma official website Note: Karma currently works on Node.js 0.10, 0.12.x, 4.x, 5.x, 6.x, and 7.x. See FAQ for more info., I guess problem might be in my node version, they recommend to install node via NVM but I already have installed node 8.. is it possible to install nvm and include there my current nodejs?
回答1:
Q: Can I still install nvm when I already got an existing node installation?
A: Yes.
nvm operates by altering your PATH environment variable to determine the node version your current shell session uses.
For instance when doing nvm use 6.10.3, you immediately can see that $PATH is set to;
PATH=/home/samuelt/.nvm/versions/node/v6.10.3/bin
which node resolves to
/home/samuelt/.nvm/versions/node/v6.10.3/bin/node
Since nvm always try to set the path of its node installation as the first occurrences in PATH even if you have 10 other node installation paths in PATH, the rest will be ignored once the system has found the node binary.
Q: Can I include my installed copy of Node as part of the installed node in nvm?
A: In theory it is possible. But I will say no. To install a particular node version in nvm you'll can do nvm install <version>
来源:https://stackoverflow.com/questions/45439495/is-it-possible-to-install-nvm-when-i-already-have-installed-nodejs-8-on-ubuntu