0

I am trying to install Phonegap to my system, I have node.js installed in the system but I get an error when trying to install the phonegap using the following command:

C:\Windows\system32>npm install -g phonegap

error stack is:

npm ERR! stack Error: connect EACCES

Here's the output I get for the command:

C:\Windows\system32>npm install -g phonegap
npm http GET https://registry.npmjs.org/phonegap
npm http GET https://registry.npmjs.org/phonegap
npm http GET https://registry.npmjs.org/phonegap
npm ERR! Error: connect EACCES
npm ERR!     at errnoException (net.js:901:11)
npm ERR!     at Object.afterConnect [as oncomplete] (net.js:892:19)
npm ERR!  { [Error: connect EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'c
onnect' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"
npm ERR! cwd C:\Windows\system32
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! syscall connect
npm ERR! code EACCES
npm ERR! errno EACCES
npm ERR! stack Error: connect EACCES
npm ERR! stack     at errnoException (net.js:901:11)
npm ERR! stack     at Object.afterConnect [as oncomplete] (net.js:892:19)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Windows\system32\npm-debug.log
npm ERR! not ok code 0
Hemantsom
  • 543
  • 2
  • 9
  • 24
  • Are you using a proxy to access internet? If yes you should be able to find plenty of posts about using npm behind a proxy. – QuickFix Mar 14 '14 at 10:16

2 Answers2

0

your node installation uses system directories. Use sudo when using -g

C:\Windows\system32> sudo npm install -g  phonegap
iamsuman
  • 1,413
  • 19
  • 32
  • running 'command prompt' as changes the path to 'C:\Windows\system32' but I still get the same error on executing the command. – Hemantsom Mar 14 '14 at 10:34
  • @jamsheer did you run using the administrator mode – iamsuman Sep 04 '14 at 05:21
  • @Jamsheer did u installed node.js ?? – iamsuman Sep 04 '14 at 07:07
  • @Sumn2u installed ...error seems like permission,but me working as admin,i have full privilege .i think more people have the same issue – Jamsheer Sep 04 '14 at 08:07
  • 1
    @jamsheer yes it is the problem in permission ! this article might be helpful for you http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo – iamsuman Sep 04 '14 at 09:40
0

run your CMD as ADMINISTRATOR role.

right click your command prompt > run as administrtor

done

Nurdin
  • 23,382
  • 43
  • 130
  • 308