A
A
Alexey Yarkov2016-10-30 19:28:32
linux
Alexey Yarkov, 2016-10-30 19:28:32

Why doesn't source ~/.bashrc work from a script?

There is a script to install the software I need.
Install nvm like this:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

This patches the ~/.bashrc file.
Now to use nvm to install Node.js , run:
source ~/.bashrc
nvm install v6.8.1

It is written in the script, but the nvm utility is not located.
At the same time, if you wait for the script to execute and manually enter source ~/.bashrc, and then nvm install v6.8.1, then everything works.
I've tried setting a delay sleep 5, but to no avail.
Why might this be happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2016-10-31
@Zarom

Specify the full path to nvm. Take it from
whereis nvm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question