node.js - -bash: npm: command not found, WHY? -


while experimenting oh-my-zsh , zsh, managed delete terminal com.apple.terminal.*, .bash_profile.

after fixing everything, terminal not recognising command. when type npm, shows:

-bash: npm: command not found

so other installed packages dotnet core.

is there way fix it?

probably need edit $path variable , set again paths.

you check current $path doing:

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

that list existing paths, , there missing $home/paths

is case add them based on requirements, in macos node/npm like:

export path="$home/node_modules/.bin:$home/library/python/2.7/bin:$home/library/python/3.6/bin:$path" 

this give priority files located in $home/node_modules/.bin

in case uninstalled or removed node try this:

brew update && brew install node 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -