node.js - Protractor 执行 config.js 不工作

标签 node.js ubuntu npm protractor

我安装了 Protractor 使用

npm install -g protractor

然后我执行了这个命令:

webdriver-manager update

接下来,我启动了它,它工作正常并且我看到了这条消息:

信息 - Selenium 服务器已启动并正在运行 问题是当我尝试

protractor config.js

它不起作用,我收到此错误:

[launcher] Process exited with error code 1

/usr/local/lib/node_modules/protractor/node_modules/q/q.js:155
            throw e;
                  ^
SyntaxError: Unexpected token )

.

我认为这是因为 Protractor 需要 node version > 4.~ 。所以我检查了我的,我发现 0.10.25 所以我尝试了

sudo npm install -g n
sudo n 4.4.0 

安装成功,当我再次检查 node -v 时,它仍然是 0.10.25

有什么帮助吗?!

最佳答案

您需要更新此 Node 链接 ( credits ):

sudo ln -sf /usr/local/n/versions/node/4.4.0/bin/node /usr/bin/node

关于node.js - Protractor 执行 config.js 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35998196/

相关文章:

git - 远程 GitHub 存储库的问题

angular - 在 Angular 库中保留符号链接(symbolic link)

javascript - Node : check latest version of package programmatically

node.js - 如何修复 : "error fsevents@2.0.7: The platform "linux"is incompatible with this module. “

ubuntu - 如何激活应用程序并将小部件集中在 gtk/ubuntu 上?

javascript - 微软语音识别+nodejs

ruby-on-rails - 非特权、非 root 用户启动或重启 webserver 服务器,例如没有 root 或 sudo 的 nginx

vue.js - VueJS : Build command `npm run build` is not able to generate `index.html`

javascript - 如何解决 TypeError : d3. 时间未定义?

node.js - Nodejs 无法与位于 ws ://apache proxy 的服务器建立连接