Protractor not installed now with npm

三世轮回 提交于 2019-12-12 05:39:17

问题


I tried to install the protractor globally with npm install -g protractor

Here is the error message,I got it in every case. I installed globally the protractor before,and worked well.

npm WARN   errno: -4048,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'lstat',
npm WARN   path: 'c:\\x\\y\npm\\node_modules\\protractor\\node_modules\\web
driver-manager\\node_modules' }
npm ERR! path c:\x\y\npm\node_modules\protractor\node_modules\.webdriver-man
ager.DELETE\selenium\chromedriver_2.26.exe
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'c:\x\y\npm\node_modu
les\protractor\node_modules\.webdriver-manager.DELETE\selenium\chromedriver_2.26
.exe'
npm ERR!  { Error: EPERM: operation not permitted, unlink 'c:\x\y\npm\node_m
odules\protractor\node_modules\.webdriver-manager.DELETE\selenium\chromedriver_2
.26.exe'
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'c:\x\y\npm\node
_modules\protractor\node_modules\.webdriver-manager.DELETE\selenium\chromedriver
_2.26.exe'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'unlink',
npm ERR!      path: 'c:\\x\\y\\npm\\node_modules\\protractor\\node_modules\\
.webdriver-manager.DELETE\\selenium\\chromedriver_2.26.exe' },
npm ERR!   stack: 'Error: EPERM: operation not permitted, unlink \'c:\\x\\y\
\npm\\node_modules\\protractor\\node_modules\\.webdriver-manager.DELETE\\seleniu
m\\chromedriver_2.26.exe\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'c:\\x\\y\\npm\\node_modules\\protractor\\node_modules\\.we
bdriver-manager.DELETE\\selenium\\chromedriver_2.26.exe',
npm ERR!   parent: 'protractor' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     c:\x\y\local\npm-cache\_logs\2017-08-22T15_38_20_888Z-debug.log

I can not do anything to this. Is there any idea to this one.


回答1:


When you download and install NPM make sure you have the latest version. Open your command prompt and type this. This might take a while to install.

npm install npm@latest -g

Or this try this link

After checking your npm version with this command

npm --version

type this to install protractor

npm install -g protractor

Then check if protractor was successfully installed by checking the version you have

protractor --version




回答2:


The problem looks like due to the caching. Clear you cache before installing

npm cache clean
npm install -g protractor

If above command won't help then delete entire .webdriver-manager.DELETE directory from your_path/.../node_modules/ and issue again above two commands.




回答3:


npm ERR! Error: EPERM: operation not permitted, unlink 'c:\x\y\npm\node_modu les\protractor\node_modules\.webdriver-manager.DELETE\selenium\chromedriver_2.26

Is there any running chromedriver.exe on Windows Task Manager. If answer is yes, kill and try again



来源:https://stackoverflow.com/questions/45834947/protractor-not-installed-now-with-npm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!