I want to run a command NVMfrom bash script ie nvm use 0.12.7. So I wrote a bash file:
#!/bin/bash
. ~/.nvm/nvm.sh
nvm use 0.12.7
And then run the command in the terminal as sudo ./script.sh(script.sh is my bash file where the code is written above). This gives me the result Now using node v0.12.7. But when I check if the version was activated or not, I did not find any influence. those. I ran the command nvm lsand found the result as:
v0.12.0
v0.12.7
This means that the version has 0.12.7not been activated. So, what things should I write in a bash script since I can activate the node version from the bash file.
source
share