Using protractor with typescript creates tsc warnings
tsc ⏎
node_modules/protractor/globals.ts(22,37): error TS2304: Cannot find name 'global'.
node_modules/protractor/globals.ts(23,31): error TS2304: Cannot find name 'global'.
node_modules/protractor/globals.ts(24,37): error TS2304: Cannot find name 'global'.
node_modules/protractor/globals.ts(25,31): error TS2304: Cannot find name 'global'.
node_modules/protractor/globals.ts(26,31): error TS2304: Cannot find name 'global'.
node_modules/protractor/globals.ts(27,51): error TS2304: Cannot find name 'global'.
node_modules/protractor/globals.ts(28,57): error TS2304: Cannot find name 'global'.
node_modules/protractor/globals.ts(30,5): error TS2304: Cannot find name 'global'.
This might not be a bug if typings.json includes the DefinitelyTyped node ambient file. Should investigate post 4.0.2 release.
After some investigation, this is not an issue. In the cookbook, the typings.json file was missing node. Having node in typings allows for 'global' to exist.
Hi @cnishina ,
I have node in typings.json and it is still not finding 'global'.
There is a fix. Although your typescript compiler is complaining, it should still work. https://github.com/angular/protractor/pull/3485
@ravitej-klair It should work, I faced similar warnings and fixed them. Try uninstalling node typings and install it again. There is a catch- typings uninstall doesn't work same as install and it is not documented as well. I do it like this:
//create typings.json file in project
typings init
//for installing ambient types
typings install --global --save dt~node
//for uninstalling
typings uninstall --global --save node