Installing Node.js: <Short description of your suggestion>
Junior1511 opened this issue · comments
Checks
- This is not a duplicate of an existing issue (please have a look through our open issues list to make sure)
- I have thoroughly read and understand The Odin Project Contributing Guide
- Would you like to work on this issue?
Describe your suggestion
The installation method is missing some things. the .zshrc file is missing text in it. This text to be more specific:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion
This was causing an error that would make the terminal not find node after it was close.
Path
Foundations
Lesson Url
https://www.theodinproject.com/lessons/foundations-installing-node-js
(Optional) Discord Name
combokid_
(Optional) Additional Comments
https://itnext.io/nvm-the-easiest-way-to-switch-node-js-environments-on-your-machine-in-a-flash-17babb7d5f1b
This is the article that helped me solve the problem. Idk if I explained it well enough.
Thank you for opening the issue!
The lesson uses NVM's automatic install script which also adds those lines to your .zshrc
, or other shell profiles. You usually do not need to add them yourself.
When you were running the install command, did you encounter any such error as described here on line 436?
That's the error nvm should have thrown when it could not find your .zshrc
and consequently was unable to add the relevant source lines to the file.
Alternatively, did you switch your shells after installing nvm, i.e. you installed it while you were using bash
, and later switched to zsh
for example?
I did not get the error described in line 436, because the TOP tutorial made me create the file .zshrc, but if you check the file there is nothing in it, even after node is fully installed. You can check the file by doing cat .zshrc.
Hmm, that is peculiar behaviour and shouldn't happen methinks.
I do still think that the installation process must've gone awry somewhere, but it may have silently failed as you say. Either way, it's something to be addressed.
I wasn't able to reproduce it though, perhaps a maintainer can help you more on this issue.
I just tested the process out on my wife's account on the MacBook Pro and it works exactly as the lesson describes.
If you do not create a ~/.zshrc
file, nvm will still install but it will warn you that it was unable to add the required export and script sourcing as it could not find the file.
You can run touch ~/.zshrc
afterwards and then rerun the installer and it will then correctly set up the required scripts.
The instructions in the lesson are fine, if you still believe there is an issue it probably needs to be raised on the nvm repository instead.