5

I was trying to do environment setup for Angular2 and for that I am getting below mentioned error while using command : npm install

enter image description here

I am having Node versions : Node version is v6.7.0, npm version is 3.10.3

Is there any solution for the same?

Nirav Shah
  • 2,064
  • 5
  • 24
  • 34
  • Nirav, Can you please try running your `CMD` as an administrator using the `Run As Administrator` and see if it works? – David R Nov 07 '16 at 06:05
  • Yes,have tried with Admin access.Still it is having same issue – Nirav Shah Nov 07 '16 at 06:28
  • Can you please try executing `npm set registry https://registry.npmjs.org/` before executing your `npm install` command? – David R Nov 07 '16 at 06:33
  • If the above is not working in your case, you will have to upgrade your `node` and `npm` to the latest – David R Nov 07 '16 at 06:34

5 Answers5

5

Solved the issue.

There was an issue with Windows System settings.

Steps to solve the issue:

Go to Windows' Settings >> Network & Internet >> Proxy Go to Automatic proxy setup >> Make 'Automatically detect settings' to off.

Now this works for me.

Thanks

Guillaume Vincent
  • 13,355
  • 13
  • 76
  • 103
Nirav Shah
  • 2,064
  • 5
  • 24
  • 34
  • but our organization disable this setting and option defaulted to On. We can not change it. is there a work round for this? – Dung Jul 16 '19 at 19:39
2

I have worked in react and I was tried to hit command npm install and I have found same above problem.

Solution is:

Check the latest update of npm:

npm install npm@next -g

Yogesh Borad
  • 4,287
  • 1
  • 18
  • 17
2

This is my error (Windows 10)

enter image description here

This is my solution:

Deleting the C:\Users\{user}\AppData\Roaming\npm and

Deleting the C:\Users\{user}\AppData\Roaming\npm-cache folder

Done! It should work!

Dung
  • 19,199
  • 9
  • 59
  • 54
1

I found two solutions for this problem.

SOLUTION 1

If you are on Windows 10 go to settings (go to start and type settings). Go to Network And Internet > Go To The Proxy tab Available on the left sidebar > under this tab you will find a setting called Automatically Detect Settings > Simply turn it off...

You are done and good to go .....

SOLUTION 2

Deleting the C:\Users\{user}\AppData\Roaming\npm and Then

Deleting the C:\Users{user}\AppData\Roaming\npm-cache folder

You are done....

halfer
  • 19,824
  • 17
  • 99
  • 186
rushabh
  • 71
  • 7
0

Initially this problem can occur due to node version. See if you're using multiple node version with your machine. If yes, you should also have nvm with you. Do nvm use latest (if up to date version is also installed) or use nvm user v16.18.0 (for example considering this is the latest/ other node version you have). Then try to install other things.

You need to use cmd with admin access to change node version using nvm.

Thanks,