By johnstephens
Whenever I log in or switch back to my main user account, the shell throws “command not found” errors for node and npm. In order to make it work, I have to run $ source ~/.profile; npm use 0.10.17. After that, the node command works again.
On IRC, someone suggested adding these commands to my .bashrc file, but when I did that, loading .bashrc hangs indefinitely. As a Mac user, I’m used to using .bash_profile like this, but this isn’t working like I expected. What is the path to enlightenment on this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Yes, It works immediately now whenever I log in fresh. The only time it doesn’t work is when I switch user to my username with <code>su john</code>, but then I can just source my .profile and it remembers that node exists.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.