1

While logged in to Windows 10 as a User, and opened the command prompt as an Adminstrator, cd to my nodeJs project directory and did npm install browser-refresh -g in order to install the browser-refresh package from the npm which went ok but with some "npm WARN deprecated" messages. and the confirmatioin

  • browser-refresh@1.7.3

then I modified my code according to the package instructions and did browser-refresh index.js which suppose to replaces node index.js but I get the error

'browser-refresh' is not recognized as an internal or external command, operable program or batch file.

So I installed it locally with out the -g tag for no avail. I able to run it using the command C:\Users\adminName\AppData\Roaming\npm\browser-refresh index.js

I added the path above to the list of Paths under "System variables > Path" for no avail. I may un install the local package since that did not work. Someone please suggests a working solution.

Even though I get it running with the long command, the pacakge did not refresh the web page after changed the index.html file and saved it but this may be a different question.

Thank you

Fred J.
  • 5,759
  • 10
  • 57
  • 106

1 Answers1

0

The path to the NPM bin folder may not be defined in your PATH environment variable. You can test this by installing another package that should be executable from the command line and checking to see if executing it results in the same error.

If it does, you can add "%AppData%\npm" to your PATH. Here are instructions on how to do so.

Yash T
  • 126
  • 1
  • 11