-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Node interpreter setup documentation #2056
Comments
If so, those scripts are broken. They should be using a shebang of |
Yes but that depends on the environment vars, which makes it hard to run in Cron, LaunchDeamons and systemd, where the environment is non existent or rudimentary. I remember having only /bin and /sbin in the path with the default cron shell |
The tradeoff there is that you need to hardcode your node path, which means you have to change it for every system and/or every node version. |
Redhat distros are very consistent about it's location... It's just always outdated. I don't deal with Debian enough to tell where apt-get likes to out it, but I imagine it's near /usr/local/bin/node The main issue here is there is no easy way to point /usr/local/bin/node to whatever the NVM default is |
The problem is that there isn’t an nvm default - there’s only per-shell PATH modifications. So if PATH isn’t available in a context, nvm isn’t really applicable or useful. |
I got my inid.d script to work with by loading the bash profile up top... |
There is no “current” outside of the current shell session. |
Went with this instead, due to serious slowdowns when network not available. I think I bricked Ubuntu on a previous machine with NVM because I ran it too early in profile.d.
|
You definitely do not want to set |
You're right... I was using it to run I updated the esm script to
could be useful for typescript bash replacement scripts too. These methods turned out to be ... WAY faster and more resilient to network issues. Specially when using in profile.d scripts and sudo su'ing around a lot. |
Operating system and version: Linux 5
How did you install
nvm
?install script in readme
What steps did you perform?
nvm install 12
What happened?
Everything worked wonderfully.
But, I have some node scripts that depend on /usr/local/bin/node existing. I can execute them just like any shell script, they have
#!/usr/local/bin/node
as the interpreter, and I run them with./my-script.js myparams
from the terminal.I expected some documentation about where to symlink
/usr/local/bin/node
to. Instead I getnode: bad interpreter: No such file or directory
errors when executing those scripts from the shell.it seems like this is not an expected use case... I can't find any symlinks to the default node anywhere. it would be nice to have a default node symlink in /alias/node. Same for npx and npm. That way we could symlink it to a standard location, or be asked if we want to do that at installation the get go.
.bashrc
,.bash_profile
,.zshrc
, etc) that modifies thePATH
?no.
The text was updated successfully, but these errors were encountered: