{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular/pulls/comments/44863333","id":44863333,"diff_hunk":"@@ -1,7 +1,41 @@\n+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n+   !!!                                                                                   !!!\n+   !!!  This file is special in that it must be able to execute with wrong Node version  !!!\n+   !!!  or even when node_modules are missing.                                           !!!\n+   !!!                                                                                   !!!\n+   !!!  Do not depend on Node4+ features or presence of npm packages here.               !!!\n+   !!!                                                                                   !!!\n+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */\n+\n+'use strict';\n+\n var exec = require('child_process').exec;\n-var semver = require('semver');\n+var checkNodeModules;\n+var semver;\n \n-var checkNodeModules = require('./npm/check-node-modules.js');\n+\n+var issues = [];\n+\n+// coarse Node version check\n+if (process.version[1] !== '4') {\n+  issues.push(\"Angular 2 build currently requires Node 4. Use nvm to update your node version.\");\n+}\n+\n+try {\n+  semver = require('semver');\n+} catch(e) {\n+  issues.push(\"Looks like you are missing some npm dependencies. Run: npm install\");\n+}\n+\n+try {\n+  checkNodeModules = require('./npm/check-node-modules.js');","path":"tools/check-environment.js","position":33,"original_position":33,"commit_id":"2d8aeddbbe1ba916e1c72aa29636aabc485d64f1","original_commit_id":"2d8aeddbbe1ba916e1c72aa29636aabc485d64f1","user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"body":"Why would that fail ?","created_at":"2015-11-14T20:42:09Z","updated_at":"2015-11-14T20:42:09Z","html_url":"https://github.com/angular/angular/pull/5290#discussion_r44863333","pull_request_url":"https://api.github.com/repos/angular/angular/pulls/5290","_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/comments/44863333"},"html":{"href":"https://github.com/angular/angular/pull/5290#discussion_r44863333"},"pull_request":{"href":"https://api.github.com/repos/angular/angular/pulls/5290"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/5290","id":50726304,"html_url":"https://github.com/angular/angular/pull/5290","diff_url":"https://github.com/angular/angular/pull/5290.diff","patch_url":"https://github.com/angular/angular/pull/5290.patch","issue_url":"https://api.github.com/repos/angular/angular/issues/5290","number":5290,"state":"open","locked":false,"title":"build: improve the environmental check and warnings","user":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"body":"- we now correctly print errors even on old Node versions\r\n- error messages looks better\r\n- we print error messages even when node_modules are missing or messed up\r\n\r\nCloses #5230","created_at":"2015-11-14T16:10:44Z","updated_at":"2015-11-14T20:42:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a394fc04ece771d596787cabdb4a7f67708a61f","assignee":{"login":"vsavkin","id":35996,"avatar_url":"https://avatars.githubusercontent.com/u/35996?v=3","gravatar_id":"","url":"https://api.github.com/users/vsavkin","html_url":"https://github.com/vsavkin","followers_url":"https://api.github.com/users/vsavkin/followers","following_url":"https://api.github.com/users/vsavkin/following{/other_user}","gists_url":"https://api.github.com/users/vsavkin/gists{/gist_id}","starred_url":"https://api.github.com/users/vsavkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsavkin/subscriptions","organizations_url":"https://api.github.com/users/vsavkin/orgs","repos_url":"https://api.github.com/users/vsavkin/repos","events_url":"https://api.github.com/users/vsavkin/events{/privacy}","received_events_url":"https://api.github.com/users/vsavkin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/angular/angular/pulls/5290/commits","review_comments_url":"https://api.github.com/repos/angular/angular/pulls/5290/comments","review_comment_url":"https://api.github.com/repos/angular/angular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular/issues/5290/comments","statuses_url":"https://api.github.com/repos/angular/angular/statuses/2d8aeddbbe1ba916e1c72aa29636aabc485d64f1","head":{"label":"IgorMinar:better-node-npm-warnings","ref":"better-node-npm-warnings","sha":"2d8aeddbbe1ba916e1c72aa29636aabc485d64f1","user":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"repo":{"id":32506583,"name":"angular","full_name":"IgorMinar/angular","owner":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IgorMinar/angular","description":"","fork":true,"url":"https://api.github.com/repos/IgorMinar/angular","forks_url":"https://api.github.com/repos/IgorMinar/angular/forks","keys_url":"https://api.github.com/repos/IgorMinar/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IgorMinar/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IgorMinar/angular/teams","hooks_url":"https://api.github.com/repos/IgorMinar/angular/hooks","issue_events_url":"https://api.github.com/repos/IgorMinar/angular/issues/events{/number}","events_url":"https://api.github.com/repos/IgorMinar/angular/events","assignees_url":"https://api.github.com/repos/IgorMinar/angular/assignees{/user}","branches_url":"https://api.github.com/repos/IgorMinar/angular/branches{/branch}","tags_url":"https://api.github.com/repos/IgorMinar/angular/tags","blobs_url":"https://api.github.com/repos/IgorMinar/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IgorMinar/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IgorMinar/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/IgorMinar/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IgorMinar/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/IgorMinar/angular/languages","stargazers_url":"https://api.github.com/repos/IgorMinar/angular/stargazers","contributors_url":"https://api.github.com/repos/IgorMinar/angular/contributors","subscribers_url":"https://api.github.com/repos/IgorMinar/angular/subscribers","subscription_url":"https://api.github.com/repos/IgorMinar/angular/subscription","commits_url":"https://api.github.com/repos/IgorMinar/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/IgorMinar/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/IgorMinar/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/IgorMinar/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/IgorMinar/angular/contents/{+path}","compare_url":"https://api.github.com/repos/IgorMinar/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IgorMinar/angular/merges","archive_url":"https://api.github.com/repos/IgorMinar/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IgorMinar/angular/downloads","issues_url":"https://api.github.com/repos/IgorMinar/angular/issues{/number}","pulls_url":"https://api.github.com/repos/IgorMinar/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/IgorMinar/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/IgorMinar/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IgorMinar/angular/labels{/name}","releases_url":"https://api.github.com/repos/IgorMinar/angular/releases{/id}","created_at":"2015-03-19T07:18:03Z","updated_at":"2015-09-25T02:50:40Z","pushed_at":"2015-11-14T16:12:49Z","git_url":"git://github.com/IgorMinar/angular.git","ssh_url":"git@github.com:IgorMinar/angular.git","clone_url":"https://github.com/IgorMinar/angular.git","svn_url":"https://github.com/IgorMinar/angular","homepage":null,"size":19763,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"9985968d894b07a40c35f148bb7983cdc45a9f8e","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":24195339,"name":"angular","full_name":"angular/angular","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular","description":"","fork":false,"url":"https://api.github.com/repos/angular/angular","forks_url":"https://api.github.com/repos/angular/angular/forks","keys_url":"https://api.github.com/repos/angular/angular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular/teams","hooks_url":"https://api.github.com/repos/angular/angular/hooks","issue_events_url":"https://api.github.com/repos/angular/angular/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular/events","assignees_url":"https://api.github.com/repos/angular/angular/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular/tags","blobs_url":"https://api.github.com/repos/angular/angular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular/languages","stargazers_url":"https://api.github.com/repos/angular/angular/stargazers","contributors_url":"https://api.github.com/repos/angular/angular/contributors","subscribers_url":"https://api.github.com/repos/angular/angular/subscribers","subscription_url":"https://api.github.com/repos/angular/angular/subscription","commits_url":"https://api.github.com/repos/angular/angular/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular/merges","archive_url":"https://api.github.com/repos/angular/angular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular/downloads","issues_url":"https://api.github.com/repos/angular/angular/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular/releases{/id}","created_at":"2014-09-18T16:12:01Z","updated_at":"2015-11-14T18:44:57Z","pushed_at":"2015-11-14T16:12:51Z","git_url":"git://github.com/angular/angular.git","ssh_url":"git@github.com:angular/angular.git","clone_url":"https://github.com/angular/angular.git","svn_url":"https://github.com/angular/angular","homepage":"https://angular.io","size":70061,"stargazers_count":6527,"watchers_count":6527,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1766,"mirror_url":null,"open_issues_count":617,"forks":1766,"open_issues":617,"watchers":6527,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular/pulls/5290"},"html":{"href":"https://github.com/angular/angular/pull/5290"},"issue":{"href":"https://api.github.com/repos/angular/angular/issues/5290"},"comments":{"href":"https://api.github.com/repos/angular/angular/issues/5290/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular/pulls/5290/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular/pulls/5290/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular/statuses/2d8aeddbbe1ba916e1c72aa29636aabc485d64f1"}}}}