3

While experimenting with oh-my-zsh and zsh, I managed to delete terminal com.apple.terminal.*, .bash_profile.

After fixing everything, my terminal is not recognising any command. When I type npm, it shows:

-bash: npm: command not found

So does for all other installed packages like dotnet core.

Is there any way to fix it?

1 Answer 1

3

Probably you just need to edit your $PATH variable and set again the paths.

You could check your current $PATH by doing:

echo -e ${PATH//:/\\n}

That will list your existing paths, and probably there will be missing some $HOME/paths

Is that the case just add them based on your requirements, in macOS for node/npm would be something like:

export PATH="$HOME/node_modules/.bin:$HOME/Library/Python/2.7/bin:$HOME/Library/Python/3.6/bin:$PATH"

This will give priority to the files located in $HOME/node_modules/.bin

In case you uninstalled or removed node you could try this:

brew update && brew install node
Sign up to request clarification or add additional context in comments.

6 Comments

Hi, thanks for the response I guess I misunderstood my problem has documented again here: stackoverflow.com/questions/46140386/…
did you try what wrote in the answer?
Yes I did, and nothing changed.
then maybe you just removed node, try to install it again
I have this heavy base of packages which I don't want to uninstall\install again :(
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.