1
votes

Below is the issue that I am facing while I tried to install Protractor, Please help me as I need to install it by tomorrow for a project.

C:\Program Files\nodejs>npm install -g protractor npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "protractor" npm ERR! node v4.6.0 npm ERR! npm v2.15.9 npm ERR! code ENOTFOUND npm ERR! errno ENOTFOUND npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND proxy.us.somecompany proxy.us.somecompany:8080 npm ERR! network This is most likely not a problem with npm itself npm ERR! network and is related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config' npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "protractor" npm ERR! node v4.6.0 npm ERR! npm v2.15.9 npm ERR! path C:\Program Files\nodejs\npm-debug.log.3958700304 npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall open

npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm-debug.log.3958700304' npm ERR! at Error (native) npm ERR! { [Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm-debug.log.3958700304'] npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'open', npm ERR! path: 'C:\Program Files\nodejs\npm-debug.log.3958700304' } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request: npm ERR! C:\Program Files\nodejs\npm-debug.log

1
As it says in the error, "Please try running this command again as root/Administrator." ? It seems your node folder is in C:/Program Files, which is not a good idea.nioKi

1 Answers

0
votes

Like @noKid mentioned, your nodejs is installed in the C:\Program Files\nodejs\ which is not ideal. To deal with your current issue, open an elevated CMD (open as an administrator) and run npm install -g protractor again.

Installing an node package with the -g flag means it will install globally. This means you will be able to use the package you install from any location.

You are seeing this error because your nodejs installation is inside C:\Program Files\nodejs\ and for an application to receive permissions to create additional resources (i.e. install protractor) it needs to be executed with administrative access.