0

I have installed nodejs ->8.12.0 and npm ->6.4.1 and trying to install angular 1.7.4
I have added environment variable path to

C:\Users\user_name\AppData\Roaming\npm

and

C:\Users\user_name\AppData\Roaming\npm\node_modules\@angular\cli\bin

but when i run npm root -g it shows current directory path, not the path i set Nodejs is install to

C:\Program Files\nodejs

John
  • 6,701
  • 3
  • 34
  • 56
k_hotspot
  • 134
  • 1
  • 1
  • 13

1 Answers1

2

I found a way to set the global path to roaming. Go to:

C:\Users\YOURNAME\.npmrc

and locate NPMRC. Edit the file to:

C:\Users\username\AppData\Roaming\npm

If .npmrc is not visible you will end to show your hidden files

Andrew
  • 26,706
  • 9
  • 85
  • 101
Mo Hafiz
  • 21
  • 4
  • When I am running yarn create I am getting No such file or directory. ```C:\users\rashid\AppData\Roaming\npm/node_modules/node/bin/node: No such file or directory```. And when I check ```$ npm root -g``` I could see the correct path, but still seeing the above error. ```C:\Users\rashid\AppData\Roaming\npm\node_modules``` – Rashid Aug 21 '23 at 06:30