Why can browser-sync version not be shown, even installation is successful?

52 Views Asked by At

I would like to install browser-sync for my AngularJS application. When I $ sudo npm install -g browser-sync and provide the Password for installation, I get the following output:

/usr/local/lib/node_modules/node/bin/browser-sync -> /usr/local/lib/node_modules/node/lib/node_modules/browser-sync/dist/bin.js npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

+ [email protected] added 152 packages from 279 contributors in 7.957s

I thought the browser-sync version 2.29.3 has been installed successfully. However, when I check the browser-sync version by $ browser-sync --version, the output is:

-bash: browser-sync: command not found

What is the underlying reason? Is browser-sync installed or not? I am looking forward to any explanations behind and the fix on it. Thanks!

1

There are 1 best solutions below

0
FannieY On
$ export PATH=$PATH:/usr/local/lib/node_modules/node/bin/

According to MacOS – Set / Change $PATH Variable Command I set the $PATH by export and I can find the check the corresponding version.