Skip to content

alias node for sudoers #43

Closed
Closed
@mpotra

Description

@mpotra

When sudoing node, 'command not found' is issued, because on most systems PATH is reset on sudo, for security reasons.
This makes 'sudo node' not work anymore.

Simply adding the following line at the end of the nvm.sh script, would fix it:

alias node='$NVM_BIN/node'
//possibly adding an alias for npm as well?

This assumes .bashrc for user contains these 3 lines:

. ~/.nvm/nvm.sh

enable aliases in sudo

alias sudo='sudo '

Metadata

Metadata

Assignees

No one assigned

    Labels

    root / multiuser issuesAnything related to using `sudo` or `su`, or using nvm across multiple user accounts.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions