how npm global install does not add packages to PATH on Windows 8.1

 

Questions


When I run npm install -g <package> it installs the packages in my user/AppData/Roaming/npm/npm_modules/ folder. This sub-folder is not in my PATH so if I try to run the package without explicitly calling the entire path the call fails with a '<package>' is not recognized as an internal or external command, operable program or batch file.

What can I do to fix this?

Thanks

 

 

————————————————-

Answer

I’m using win8.1 and I found that the nodejs installer didn’t add the path to global node modules to the system PATH. Just add %AppData%npm; to the user variable(since %AppData% dir is depending on user) PATH to fix it.

You will need to log out then log back in for the change to your PATH variable to take effect.

node.js,npm,windows

Facebook Comments

Post a comment