{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/8582","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/8582/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/8582/comments","events_url":"https://api.github.com/repos/angular/angular/issues/8582/events","html_url":"https://github.com/angular/angular/issues/8582","id":154140873,"number":8582,"title":"CLI template compiler error on Windows","user":{"login":"lmcnulty4","id":12350206,"avatar_url":"https://avatars.githubusercontent.com/u/12350206?v=3","gravatar_id":"","url":"https://api.github.com/users/lmcnulty4","html_url":"https://github.com/lmcnulty4","followers_url":"https://api.github.com/users/lmcnulty4/followers","following_url":"https://api.github.com/users/lmcnulty4/following{/other_user}","gists_url":"https://api.github.com/users/lmcnulty4/gists{/gist_id}","starred_url":"https://api.github.com/users/lmcnulty4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmcnulty4/subscriptions","organizations_url":"https://api.github.com/users/lmcnulty4/orgs","repos_url":"https://api.github.com/users/lmcnulty4/repos","events_url":"https://api.github.com/users/lmcnulty4/events{/privacy}","received_events_url":"https://api.github.com/users/lmcnulty4/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20compiler-cli","name":"comp: compiler-cli","color":"c7def8"},{"url":"https://api.github.com/repos/angular/angular/labels/type:%20bug","name":"type: bug","color":"EEEEEE"}],"state":"closed","locked":false,"assignee":{"login":"alexeagle","id":47395,"avatar_url":"https://avatars.githubusercontent.com/u/47395?v=3","gravatar_id":"","url":"https://api.github.com/users/alexeagle","html_url":"https://github.com/alexeagle","followers_url":"https://api.github.com/users/alexeagle/followers","following_url":"https://api.github.com/users/alexeagle/following{/other_user}","gists_url":"https://api.github.com/users/alexeagle/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeagle/subscriptions","organizations_url":"https://api.github.com/users/alexeagle/orgs","repos_url":"https://api.github.com/users/alexeagle/repos","events_url":"https://api.github.com/users/alexeagle/events{/privacy}","received_events_url":"https://api.github.com/users/alexeagle/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexeagle","id":47395,"avatar_url":"https://avatars.githubusercontent.com/u/47395?v=3","gravatar_id":"","url":"https://api.github.com/users/alexeagle","html_url":"https://github.com/alexeagle","followers_url":"https://api.github.com/users/alexeagle/followers","following_url":"https://api.github.com/users/alexeagle/following{/other_user}","gists_url":"https://api.github.com/users/alexeagle/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeagle/subscriptions","organizations_url":"https://api.github.com/users/alexeagle/orgs","repos_url":"https://api.github.com/users/alexeagle/repos","events_url":"https://api.github.com/users/alexeagle/events{/privacy}","received_events_url":"https://api.github.com/users/alexeagle/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/58","html_url":"https://github.com/angular/angular/milestones/Angular%202%20Final","labels_url":"https://api.github.com/repos/angular/angular/milestones/58/labels","id":1695358,"number":58,"title":"Angular 2 Final","description":"","creator":{"login":"mhevery","id":111951,"avatar_url":"https://avatars.githubusercontent.com/u/111951?v=3","gravatar_id":"","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":23,"state":"open","created_at":"2016-04-09T17:18:01Z","updated_at":"2016-08-18T09:51:03Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-05-11T01:21:22Z","updated_at":"2016-08-18T09:51:03Z","closed_at":"2016-08-18T09:51:03Z","body":"The CLI template compiler is failing on Windows with the following:\r\n\r\n```\r\n> ngc -p .\r\n\r\ncan't resolve module @angular/core/src/di/provider from C:\\ng2-compiler-test2-master\\index.ts\r\nError: Could not resolve module @angular/core/src/di/provider relative to C:\\ng2-compiler-test2-master\\index.ts\r\n    at NodeReflectorHost.findDeclaration (C:\\ng2-compiler-test2-master\\node_modules\\@angular\\compiler-cli\\reflector_host.js:90:23)\r\n    at StaticReflector.initializeConversionMap (C:\\ng2-compiler-test2-master\\node_modules\\@angular\\compiler-cli\\static_reflector.js:127:55)\r\n    at new StaticReflector (C:\\ng2-compiler-test2-master\\node_modules\\@angular\\compiler-cli\\static_reflector.js:33:14)\r\n    at Function.CodeGenerator.create (C:\\ng2-compiler-test2-master\\node_modules\\@angular\\compiler-cli\\codegen.js:122:31)\r\n    at main (C:\\ng2-compiler-test2-master\\node_modules\\@angular\\compiler-cli\\main.js:37:37)\r\n    at Object.<anonymous> (C:\\ng2-compiler-test2-master\\node_modules\\@angular\\compiler-cli\\main.js:62:5)\r\n    at Module._compile (module.js:413:34)\r\n    at Object.Module._extensions..js (module.js:422:10)\r\n    at Module.load (module.js:357:32)\r\n    at Function.Module._load (module.js:314:12)\r\nCompilation failed\r\n\r\nnpm ERR! Windows_NT 10.0.10586\r\nnpm ERR! argv \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Users\\\\L\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js\" \"run\" \"_codegen\"\r\nnpm ERR! node v5.11.1\r\nnpm ERR! npm  v3.8.3\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! ng2-compiler-test2@1.0.0 _codegen: `ngc -p .`\r\nnpm ERR! Exit status 1\r\nnpm ERR!\r\nnpm ERR! Failed at the ng2-compiler-test2@1.0.0 _codegen script 'ngc -p .'.\r\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\r\nnpm ERR! If you do, this is most likely a problem with the ng2-compiler-test2 package,\r\nnpm ERR! not with npm itself.\r\nnpm ERR! Tell the author that this fails on your system:\r\nnpm ERR!     ngc -p .\r\nnpm ERR! You can get information on how to open an issue for this project with:\r\nnpm ERR!     npm bugs ng2-compiler-test2\r\nnpm ERR! Or if that isn't available, you can get their info via:\r\nnpm ERR!     npm owner ls ng2-compiler-test2\r\nnpm ERR! There is likely additional logging output above.\r\n```\r\n\r\nThis is due to path.join using backslashes in Windows. TypeScript is not normalizing these backslashes into forward slashes (despite having an unexposed normalizePath function) and so can't properly resolve modules.\r\n\r\nA possible correction for this is, in modules/@angular/compiler_cli/src/reflector_host.ts, update the resolve function from the following: \r\n\r\n```\r\n  private resolve(m: string, containingFile: string) {\r\n    const resolved =\r\n        ts.resolveModuleName(m, containingFile, this.options, this.compilerHost).resolvedModule;\r\n    return resolved ? resolved.resolvedFileName : null;\r\n  };\r\n```\r\n\r\nto the following:\r\n\r\n```\r\n  private resolve(m: string, containingFile: string) {\r\n    const resolved =\r\n        ts.resolveModuleName(m, containingFile.replace(/\\\\/g,'/'), this.options, this.compilerHost).resolvedModule;\r\n    return resolved ? resolved.resolvedFileName : null;\r\n  };\r\n```"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/240676754","html_url":"https://github.com/angular/angular/issues/8582#issuecomment-240676754","issue_url":"https://api.github.com/repos/angular/angular/issues/8582","id":240676754,"user":{"login":"mlaval","id":2316643,"avatar_url":"https://avatars.githubusercontent.com/u/2316643?v=3","gravatar_id":"","url":"https://api.github.com/users/mlaval","html_url":"https://github.com/mlaval","followers_url":"https://api.github.com/users/mlaval/followers","following_url":"https://api.github.com/users/mlaval/following{/other_user}","gists_url":"https://api.github.com/users/mlaval/gists{/gist_id}","starred_url":"https://api.github.com/users/mlaval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlaval/subscriptions","organizations_url":"https://api.github.com/users/mlaval/orgs","repos_url":"https://api.github.com/users/mlaval/repos","events_url":"https://api.github.com/users/mlaval/events{/privacy}","received_events_url":"https://api.github.com/users/mlaval/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T09:51:03Z","updated_at":"2016-08-18T09:51:03Z","body":"This issue is no longer occurring, but the compiler still doesn't work on Windows.\r\nSee https://github.com/angular/angular/issues/10792 for the resolution."}}
{"actor":{"display_login":"mlaval"}}