Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing Node.js: <Short description of your suggestion> #28076

Closed
2 of 3 tasks
Junior1511 opened this issue May 28, 2024 · 4 comments
Closed
2 of 3 tasks

Installing Node.js: <Short description of your suggestion> #28076

Junior1511 opened this issue May 28, 2024 · 4 comments

Comments

@Junior1511
Copy link

Checks

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.

@gingkapls
Copy link
Contributor

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?

@Junior1511
Copy link
Author

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.

@gingkapls
Copy link
Contributor

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.

@xandora
Copy link
Member

xandora commented Jun 14, 2024

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.

@xandora xandora closed this as completed Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants