webdriver-manager更新错误:EACCES,权限被拒绝

时间:2015-03-16 14:14:59

标签: javascript node.js selenium-webdriver npm protractor

我曾经成功运行过Protractor测试(在Mac上),我试图升级版本,所以我跑了

$npm install -g protractor

并且它似乎有效 - 运行时

$protractor --version

我得到了

Version 1.8.0

但现在,在运行时

$webdriver-manager start

我得到了

 fs.js:642
  return binding.mkdir(pathModule._makeLong(path),
             ^
Error: EACCES, permission denied   '/usr/local/lib/node_modules/protractor/selenium'
at Object.fs.mkdirSync (fs.js:642:18)
at Object.<anonymous> (/usr/local/lib/node_modules/protractor/bin/webdriver-     manager:108:6)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3

任何想法?

1 个答案:

答案 0 :(得分:12)

您需要使用webdriver-manager update

运行sudo
$ sudo -s
$ webdriver-manager update