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

Incorrect initialization in Linux when using nvm #740

Open
anatolyshilov opened this issue Dec 6, 2022 · 0 comments
Open

Incorrect initialization in Linux when using nvm #740

anatolyshilov opened this issue Dec 6, 2022 · 0 comments

Comments

@anatolyshilov
Copy link

The extension executes 'npm root -g' command in order to detect the global node module path.
I'm using nvm to manage Node versions and it adds the following lines to my .bash_profile:

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

These lines add the directory containing 'node' and 'npm' executables to the PATH. In my case (Ubuntu 22.04, bash 5.1.16(1)-release) .bashrc won't be executed from a non-interactive shell (i.e. one started without '-i' flag). So when yeoman-ui executes npm, it is not on the PATH, and the command fails resulting in a promise that never resolves. The extension remains semi-initialized forever, showing an empty page instead of the template wizard

A similar issue is discussed in this SO queston: https://stackoverflow.com/questions/51000556/npm-command-not-found-in-visual-studio-code

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

1 participant