Anna
Anna

Reputation: 1003

Not able to run globally installed node packages

I have nodejs in my system. And I installed "http-server" globally using npm( npm install -g http-server). After installing http-server I tried to run http-server, but it is showing "'http-server' is not recognized as an internal or external command, operable program or batch file."

I have added "%AppData%\Roaming\npm;" in NODE_PATH and "C:\Program Files\nodejs\;/usr/local/share/npm/bin/;" in PATH. But still I have the same issue.

Can anyone help me on this.

Upvotes: 3

Views: 4438

Answers (2)

Loi Nguyen Huynh
Loi Nguyen Huynh

Reputation: 9928

Run this:

export PATH="$(yarn global bin):$PATH"

Read more here

Upvotes: 0

Himanshu Shekhar
Himanshu Shekhar

Reputation: 1262

Open command prompt and do following :

  1. npm config get prefix And append the output of above command to PATH for example:

o/p C:\Users\username\AppData\Roaming\npm

  1. Do as set PATH=%PATH%;C:\Users\username\AppData\Roaming\npm

Upvotes: 13

Related Questions