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

/bin/sh: line 1: npm: command not found using linux, nvm #142

Open
husudosu opened this issue Nov 5, 2023 · 1 comment
Open

/bin/sh: line 1: npm: command not found using linux, nvm #142

husudosu opened this issue Nov 5, 2023 · 1 comment

Comments

@husudosu
Copy link

husudosu commented Nov 5, 2023

Hey,
The issue is similar to the mac related error discussed here: ionic-team/vscode-extension#90

image

The /bin/sh: line 1: npm: command not found error disappears when I'm change "Shell Path" in ionic plugin settings to this

PATH=$PATH:/home/sudosu/.nvm/versions/node/v20.9.0/bin /bin/zsh 

In this case I get a failed state without reason.
image

Environment:

  • OS: Manjaro
  • Node version: v20.9.0
  • NPM Version: 10.1.0

What can I do to fix this issue?
Thanks in advance!

@dtarnawsky
Copy link
Contributor

You'll need to have node (and npm) in your path for your terminal (specifically the one VS Code is using).

This is part of installing node and one way you can do this is cd to the path you installed node and run:

$ echo "export PATH=\$PATH:$(pwd)" >> ~/.bashrc

(then restart VS Code for it to take effect).

Your path may be stored in /etc/profile or ~/. profile depending on how you have configured your OS.

If you are using nvm for your project you'll still need to have the paths for node for VS Code and the extension defined because the version you use for your project is not the same as the one you use for VS Code/Extension.

@kensodemann kensodemann transferred this issue from ionic-team/vscode-extension May 13, 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

2 participants