如何设置保护程序的路径?

问题描述 投票:0回答:1

运行protactor时收到此错误消息

错误消息:

protractor : The term 'protractor' is not      
recognized as the name of a cmdlet, function,  
script file, or operable program. Check the    
spelling of the name, or if a path was         
included, verify that the path is correct and  
try again.

我无意中删除了我的node_modules文件夹,但随后又添加了它,并且在运行量角器或webdriver-manager时出现此错误

尝试执行时遇到此错误

npm install -g protractor
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\145702\AppData\Roaming\npm\node_modules\protractor\node_modules\.webdriver-manager.DELETE\selenium\MicrosoftWebDriver.exe
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\145702\AppData\Roaming\npm\node_modules\protractor\node_modules\.webdriver-manager.DELETE\selenium\MicrosoftWebDriver.exe'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\145702\AppData\Roaming\npm\node_modules\protractor\node_modules\.webdriver-manager.DELETE\selenium\MicrosoftWebDriver.exe'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\145702\AppData\Roaming\npm\node_modules\protractor\node_modules\.webdriver-manager.DELETE\selenium\MicrosoftWebDriver.exe'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'C:\\Users\\145702\\AppData\\Roaming\\npm\\node_modules\\protractor\\node_modules\\.webdriver-manager.DELETE\\selenium\\MicrosoftWebDriver.exe'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, unlink 'C:\\Users\\145702\\AppData\\Roaming\\npm\\node_modules\\protractor\\node_modules\\.webdriver-manager.DELETE\\selenium\\MicrosoftWebDriver.exe'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\145702\\AppData\\Roaming\\npm\\node_modules\\protractor\\node_modules\\.webdriver-manager.DELETE\\selenium\\MicrosoftWebDriver.exe',
npm ERR!   parent: 'protractor'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\145702\AppData\Roaming\npm-cache\_logs\2020-04-22T00_49_43_150Z-debug.log


selenium protractor
1个回答
0
投票

运行此命令:npm install -g protractor

© www.soinside.com 2019 - 2024. All rights reserved.