{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9545","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9545/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9545/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9545/events","html_url":"https://github.com/Microsoft/TypeScript/issues/9545","id":164219846,"number":9545,"title":"Node projects with --lib es6: cannot find name 'console'","user":{"login":"yortus","id":1252361,"avatar_url":"https://avatars.githubusercontent.com/u/1252361?v=3","gravatar_id":"","url":"https://api.github.com/users/yortus","html_url":"https://github.com/yortus","followers_url":"https://api.github.com/users/yortus/followers","following_url":"https://api.github.com/users/yortus/following{/other_user}","gists_url":"https://api.github.com/users/yortus/gists{/gist_id}","starred_url":"https://api.github.com/users/yortus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yortus/subscriptions","organizations_url":"https://api.github.com/users/yortus/orgs","repos_url":"https://api.github.com/users/yortus/repos","events_url":"https://api.github.com/users/yortus/events{/privacy}","received_events_url":"https://api.github.com/users/yortus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Typings","name":"Typings","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"assignees":[{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/24","html_url":"https://github.com/Microsoft/TypeScript/milestones/TypeScript%202.0.1","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/24/labels","id":1866143,"number":24,"title":"TypeScript 2.0.1","description":"","creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":36,"closed_issues":63,"state":"open","created_at":"2016-07-05T21:38:13Z","updated_at":"2016-08-13T05:10:56Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-07-07T03:03:43Z","updated_at":"2016-08-15T05:17:48Z","closed_at":null,"body":"\r\n**TypeScript Version:** nightly (2.0.0-dev.20160706)\r\n\r\n**Code**\r\n\r\n```ts\r\n// Before compiling: npm install @types/node\r\n// Compile options: { \"lib\": [\"es6\"], \"types\": [\"node\"] }\r\nprocess.cwd();          // OK\r\nconsole.log('testing'); // ERROR: Cannot find name 'console'\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nCompiles without errors\r\n\r\n**Actual behavior:** \r\n\r\n`console` is not defined\r\n\r\n**More Info:**\r\n\r\n`node.d.ts` does not contain a definition for the global `console` instance or for the `Console` class. References to `console` are resolved against the definitions from `lib.dom.d.ts`. But now with the `--lib` option, Node projects can opt out of the ambient DOM typings. That brings up the problem that `console` is not defined.\r\n\r\nIt's not as simple as just copying the ambient `console` and `Console` definitions from `lib.dom.d.ts` into `node.d.ts`, because in browsers the `Console` constructor is globally available but in Node it is not. 'Hiding' `Console` under the `NodeJS` namepace in `node.d.ts` wont work either because then projects that *don't* use the `--lib` option will get conflicting DOM and Node definitions and will see the error `TS2403: Subsequent variable declarations must have the same type.  Variable 'console' must be of type 'Console', but here has type 'Console'.`\r\n\r\nI'm testing out changes to `node.d.ts` that will work both with and without `--lib`, and will submit a PR to DefinitelyTyped if I can get it working.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/239731041","html_url":"https://github.com/Microsoft/TypeScript/issues/9545#issuecomment-239731041","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/9545","id":239731041,"user":{"login":"frogcjn","id":1777562,"avatar_url":"https://avatars.githubusercontent.com/u/1777562?v=3","gravatar_id":"","url":"https://api.github.com/users/frogcjn","html_url":"https://github.com/frogcjn","followers_url":"https://api.github.com/users/frogcjn/followers","following_url":"https://api.github.com/users/frogcjn/following{/other_user}","gists_url":"https://api.github.com/users/frogcjn/gists{/gist_id}","starred_url":"https://api.github.com/users/frogcjn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frogcjn/subscriptions","organizations_url":"https://api.github.com/users/frogcjn/orgs","repos_url":"https://api.github.com/users/frogcjn/repos","events_url":"https://api.github.com/users/frogcjn/events{/privacy}","received_events_url":"https://api.github.com/users/frogcjn/received_events","type":"User","site_admin":false},"created_at":"2016-08-15T05:17:48Z","updated_at":"2016-08-15T05:17:48Z","body":"How to resolve this problem?"}}
{"actor":{"display_login":"frogcjn"}}