Angular2 - npm install didn't find namespace webdriver

后端 未结 2 1835
抹茶落季
抹茶落季 2021-01-17 11:30

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)         


        
相关标签:
2条回答
  • 2021-01-17 12:20

    For those still experiencing issues after upgrading to Protractor 4.0.14, I found that my classes that referenced webdriver now required an import statement:

    import webdriver = require('selenium-webdriver');
    

    Hope that helps anyone with the same issue.

    0 讨论(0)
  • 2021-01-17 12:26

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

    protractor has a dependency on selenium-webdriver:

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

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

    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
    

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

    There is a PR pending in : https://github.com/angular/protractor/pull/3848

    0 讨论(0)
提交回复
热议问题