Angular2-npm安装未找到名称空间webdriver [英] Angular2 - npm install didn't find namespace webdriver

查看:98
本文介绍了Angular2-npm安装未找到名称空间webdriver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

重新启动Angular2项目后,我启动了命令npm install并出现以下错误:

After reinitiating an Angular2 project, I've launch the command npm install and got the following error :

node_modules/protractor/built/browser.d.ts(258,37): error TS2503: Cannot find namespace 'webdriver'

任何人都知道它来自哪里/如何解决?

Anyone knows where it comes from/ how can I fixed it ?

谢谢你

推荐答案

2016年12月21日更新:自量角器4.0.14起已修复.

Update 21-12-2016: This is fixed as of protractor 4.0.14.

量角器依赖于selenium-webdriver:

protractor has a dependency on selenium-webdriver:

'@ types/selenium-webdriver':'〜2.53.31',

'@types/selenium-webdriver': '~2.53.31',

不幸的是, https://github.com/DefinitelyTyped/DefinitelyTyped/pull/13382已于昨天合并,并以2.53.37发行.

unfortunately, https://github.com/DefinitelyTyped/DefinitelyTyped/pull/13382 was merged yesterday and released as 2.53.37.

临时修复:手动安装版本2.53.36可以解决此问题,直到量角器发布包含selenium-webdriver软件包中的更改的新版本.

Temporary fix : manually installing version 2.53.36 fixes the problem until protractor releases a new version incorporating the changes from the selenium-webdriver package.

npm install @types/selenium-webdriver@2.53.36 --save-dev

并在量角器修复后立即删除dev依赖项.

and remove the dev dependency as soon as protractor is fixed.

有一个PR待审核: https://github.com/angular/protractor/pull/3848

这篇关于Angular2-npm安装未找到名称空间webdriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆