Browserify command not found

Quick question, when I run browserify index.js -o app.js from the mac terminal, I get a command not found. I did npm install -g but still no luck. Any idea why I get this?

thanks

It was easier for me to make the point than to paste here: https://gist.github.com/pertrai1/4ccf77e7b31cb5628b5d

+6
source share
3 answers

Add this to your ~/.bashrc or equivalent:

export PATH=$PATH:~/.npm-global/bin/

Then, in order for this to actually take effect in a terminal session, do source ~/.bashrc .

At this point, you can execute browserify , as well as potentially many other commands. Check ~/.npm-global/bin/ to see what has become available.

+4
source

Just install it in a global space, for example, if you need to run it from the command line.

npm install browserify -g

You may need to run

npm uninstall browserify -g just to make sure you don't have false aliases.

+2
source

I could not get browserify to work.

It works ~/.npm/bin/browserify .

Other packages seem to work fine (e.g. phantomjs).

The workaround seems to add alias browserify='~/.npm/bin/browserify' to your .bash_profile

+1
source

Source: https://habr.com/ru/post/972807/


All Articles