{"action":"created","comment":{"url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/comments/87971453","pull_request_review_id":8559131,"id":87971453,"diff_hunk":"@@ -48,30 +24,54 @@ export class NodePackageManager implements INodePackageManager {\n \t\t\t}\n \n \t\t\ttry {\n-\t\t\t\treturn this.loadAndExecute(\"install\", [pathToSave, packageName], { config: config }).wait();\n+\t\t\t\tlet jsonContentBefore = this.$fs.readJson(path.join(pathToSave, \"package.json\")).wait();\n+\t\t\t\tlet dependenciesBefore: Array<string> = [];\n+\t\t\t\tif(jsonContentBefore && jsonContentBefore.dependencies) {\n+\t\t\t\t\tfor(let name in jsonContentBefore.dependencies) {\n+\t\t\t\t\t\tdependenciesBefore.push(name);\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\n+\t\t\t\tlet flags = this.getFlagsString(config, true);\n+\t\t\t\tlet params = [\"install\"];\n+\t\t\t\tif(packageName !== pathToSave) {\n+\t\t\t\t\tparams.push(packageName); //because npm install ${pwd} on mac tries to install itself as a dependency (windows and linux have no such issues)\n+\t\t\t\t}\n+\t\t\t\tparams = params.concat(flags);\n+\t\t\t\tthis.$childProcess.spawnFromEvent(\"npm\", params, \"close\", { cwd: pathToSave }).wait();","path":"lib/node-package-manager.ts","position":70,"original_position":65,"commit_id":"6b73294319d13d0f6582901b05ec7fd90ab824af","original_commit_id":"e77791853351dcec15172841c3565cbfb8e21780","user":{"login":"rosen-vladimirov","id":8351653,"avatar_url":"https://avatars.githubusercontent.com/u/8351653?v=3","gravatar_id":"","url":"https://api.github.com/users/rosen-vladimirov","html_url":"https://github.com/rosen-vladimirov","followers_url":"https://api.github.com/users/rosen-vladimirov/followers","following_url":"https://api.github.com/users/rosen-vladimirov/following{/other_user}","gists_url":"https://api.github.com/users/rosen-vladimirov/gists{/gist_id}","starred_url":"https://api.github.com/users/rosen-vladimirov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosen-vladimirov/subscriptions","organizations_url":"https://api.github.com/users/rosen-vladimirov/orgs","repos_url":"https://api.github.com/users/rosen-vladimirov/repos","events_url":"https://api.github.com/users/rosen-vladimirov/events{/privacy}","received_events_url":"https://api.github.com/users/rosen-vladimirov/received_events","type":"User","site_admin":false},"body":"To be more precise in the explanation:\r\n - on Windows, the default command prompt is able to resolve npm to `npm.cmd` when you execute `npm install`\r\n - childProcess.spawn method does not launch new shell, it just starts executable in PATH (or passed with full path)\r\n\r\nIn the current case, childProcess is trying to start a new process called `npm` but it cannot be resolved as the real name of the executable on Windows is `npm.cmd`.\r\nWe have such code, you can take a look at it [here](https://github.com/telerik/mobile-cli-lib/blob/79633174cb36302a0ec4c1eecc382ff45f7898ed/appbuilder/services/npm-service.ts#L51-L61)","created_at":"2016-11-15T08:57:21Z","updated_at":"2016-11-15T08:57:21Z","html_url":"https://github.com/NativeScript/nativescript-cli/pull/2209#discussion_r87971453","pull_request_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/2209","_links":{"self":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/comments/87971453"},"html":{"href":"https://github.com/NativeScript/nativescript-cli/pull/2209#discussion_r87971453"},"pull_request":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/2209"}}},"pull_request":{"url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/2209","id":92924108,"html_url":"https://github.com/NativeScript/nativescript-cli/pull/2209","diff_url":"https://github.com/NativeScript/nativescript-cli/pull/2209.diff","patch_url":"https://github.com/NativeScript/nativescript-cli/pull/2209.patch","issue_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/2209","number":2209,"state":"open","locked":false,"title":"remove npm2 dependency","user":{"login":"Plamen5kov","id":5918351,"avatar_url":"https://avatars.githubusercontent.com/u/5918351?v=3","gravatar_id":"","url":"https://api.github.com/users/Plamen5kov","html_url":"https://github.com/Plamen5kov","followers_url":"https://api.github.com/users/Plamen5kov/followers","following_url":"https://api.github.com/users/Plamen5kov/following{/other_user}","gists_url":"https://api.github.com/users/Plamen5kov/gists{/gist_id}","starred_url":"https://api.github.com/users/Plamen5kov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Plamen5kov/subscriptions","organizations_url":"https://api.github.com/users/Plamen5kov/orgs","repos_url":"https://api.github.com/users/Plamen5kov/repos","events_url":"https://api.github.com/users/Plamen5kov/events{/privacy}","received_events_url":"https://api.github.com/users/Plamen5kov/received_events","type":"User","site_admin":false},"body":"## What does this PR do?\r\nPR removes the local npm2 dependency from CLI. Fix for: https://github.com/NativeScript/nativescript-cli/issues/1845\r\n\r\n_Description_\r\nCache functionality is removed from `lib/node-package-manager.ts` and `lib/npm-installation-manager`. Other changes are made along the way to accommodate the lack of the cache add cache unpack functionality.\r\n\r\n### How did it work till now?\r\n* On npm install template: template is saved to `tmp` folder in some cases and to cache in others, and then are extracted to app folder. If Template is not default, the default template was downloaded because it's the only one that has `App_Resources` folder. The `App_Resources` folder is copied to new template.\r\n* On npm install core-framework (tns-ios, tns-android), tns-core-framework is saved to cache and extracted to `platforms/` folder\r\n* On npm install `node-inspector`, package is saved and extracted to cache.\r\n* On tns platform update we always updated iOS \r\n\r\n### How will it work after this PR\r\n* On npm install, all packages are treated as normal node packages. That means all of them are installed in the node modules and in the case of the templates and the core-frameworks the packages are uninstalled after they are extracted to `app/` and to `platforms/` folders respectively. All templates will be expected to have an `App_Resources` folder with them.\r\n* We check the current iOS proj file and the new one and if they are different, there is a failure on update.\r\n* Currently the ios-node-inspector that is being installed through npm is in node_modules folder for each project. We might think of a way to make an exception for the inspector because of it's size.\r\n\r\n> The implementation works with npm cache internally.\r\n\r\n### Expected\r\nBecause not all templates have an `App_Resource` folder yet, there are tests that are expected to fail with: `Project's app/App_Resources must contain Android and iOS directories.`\r\n\r\n### Related PR\r\nThese PR add `App_Resource` folder to templates that don't have it. From now on all templates will have to carry with them an `App_Resource` folder.\r\nhttps://github.com/NativeScript/template-hello-world-ts/pull/21\r\nhttps://github.com/NativeScript/template-hello-world-ng/pull/34\r\n\r\nping: @NativeScript/android-runtime @rosen-vladimirov @hshristov @tzraikov @hdeshev @KristinaKoeva","created_at":"2016-11-09T08:51:12Z","updated_at":"2016-11-15T08:57:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fce08676051d7e5a25521fdff0d0345f7a2407f1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/2209/commits","review_comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/2209/comments","review_comment_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/2209/comments","statuses_url":"https://api.github.com/repos/NativeScript/nativescript-cli/statuses/6b73294319d13d0f6582901b05ec7fd90ab824af","head":{"label":"NativeScript:plamen5kov/remove_npm2_dependency","ref":"plamen5kov/remove_npm2_dependency","sha":"6b73294319d13d0f6582901b05ec7fd90ab824af","user":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"repo":{"id":21347346,"name":"nativescript-cli","full_name":"NativeScript/nativescript-cli","owner":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NativeScript/nativescript-cli","description":"Command-line interface for building NativeScript apps","fork":false,"url":"https://api.github.com/repos/NativeScript/nativescript-cli","forks_url":"https://api.github.com/repos/NativeScript/nativescript-cli/forks","keys_url":"https://api.github.com/repos/NativeScript/nativescript-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NativeScript/nativescript-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NativeScript/nativescript-cli/teams","hooks_url":"https://api.github.com/repos/NativeScript/nativescript-cli/hooks","issue_events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/events{/number}","events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/events","assignees_url":"https://api.github.com/repos/NativeScript/nativescript-cli/assignees{/user}","branches_url":"https://api.github.com/repos/NativeScript/nativescript-cli/branches{/branch}","tags_url":"https://api.github.com/repos/NativeScript/nativescript-cli/tags","blobs_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NativeScript/nativescript-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/NativeScript/nativescript-cli/languages","stargazers_url":"https://api.github.com/repos/NativeScript/nativescript-cli/stargazers","contributors_url":"https://api.github.com/repos/NativeScript/nativescript-cli/contributors","subscribers_url":"https://api.github.com/repos/NativeScript/nativescript-cli/subscribers","subscription_url":"https://api.github.com/repos/NativeScript/nativescript-cli/subscription","commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/NativeScript/nativescript-cli/contents/{+path}","compare_url":"https://api.github.com/repos/NativeScript/nativescript-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NativeScript/nativescript-cli/merges","archive_url":"https://api.github.com/repos/NativeScript/nativescript-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NativeScript/nativescript-cli/downloads","issues_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues{/number}","pulls_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/NativeScript/nativescript-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/NativeScript/nativescript-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NativeScript/nativescript-cli/labels{/name}","releases_url":"https://api.github.com/repos/NativeScript/nativescript-cli/releases{/id}","deployments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/deployments","created_at":"2014-06-30T10:21:20Z","updated_at":"2016-11-14T10:51:21Z","pushed_at":"2016-11-15T08:22:30Z","git_url":"git://github.com/NativeScript/nativescript-cli.git","ssh_url":"git@github.com:NativeScript/nativescript-cli.git","clone_url":"https://github.com/NativeScript/nativescript-cli.git","svn_url":"https://github.com/NativeScript/nativescript-cli","homepage":"https://www.npmjs.com/package/nativescript","size":37761,"stargazers_count":457,"watchers_count":457,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":98,"forks":83,"open_issues":98,"watchers":457,"default_branch":"master"}},"base":{"label":"NativeScript:master","ref":"master","sha":"94c534d5e52112abac5a2165e40b7d0c60e46ffd","user":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"repo":{"id":21347346,"name":"nativescript-cli","full_name":"NativeScript/nativescript-cli","owner":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NativeScript/nativescript-cli","description":"Command-line interface for building NativeScript apps","fork":false,"url":"https://api.github.com/repos/NativeScript/nativescript-cli","forks_url":"https://api.github.com/repos/NativeScript/nativescript-cli/forks","keys_url":"https://api.github.com/repos/NativeScript/nativescript-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NativeScript/nativescript-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NativeScript/nativescript-cli/teams","hooks_url":"https://api.github.com/repos/NativeScript/nativescript-cli/hooks","issue_events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/events{/number}","events_url":"https://api.github.com/repos/NativeScript/nativescript-cli/events","assignees_url":"https://api.github.com/repos/NativeScript/nativescript-cli/assignees{/user}","branches_url":"https://api.github.com/repos/NativeScript/nativescript-cli/branches{/branch}","tags_url":"https://api.github.com/repos/NativeScript/nativescript-cli/tags","blobs_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NativeScript/nativescript-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/NativeScript/nativescript-cli/languages","stargazers_url":"https://api.github.com/repos/NativeScript/nativescript-cli/stargazers","contributors_url":"https://api.github.com/repos/NativeScript/nativescript-cli/contributors","subscribers_url":"https://api.github.com/repos/NativeScript/nativescript-cli/subscribers","subscription_url":"https://api.github.com/repos/NativeScript/nativescript-cli/subscription","commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/NativeScript/nativescript-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/NativeScript/nativescript-cli/contents/{+path}","compare_url":"https://api.github.com/repos/NativeScript/nativescript-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NativeScript/nativescript-cli/merges","archive_url":"https://api.github.com/repos/NativeScript/nativescript-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NativeScript/nativescript-cli/downloads","issues_url":"https://api.github.com/repos/NativeScript/nativescript-cli/issues{/number}","pulls_url":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/NativeScript/nativescript-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/NativeScript/nativescript-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NativeScript/nativescript-cli/labels{/name}","releases_url":"https://api.github.com/repos/NativeScript/nativescript-cli/releases{/id}","deployments_url":"https://api.github.com/repos/NativeScript/nativescript-cli/deployments","created_at":"2014-06-30T10:21:20Z","updated_at":"2016-11-14T10:51:21Z","pushed_at":"2016-11-15T08:22:30Z","git_url":"git://github.com/NativeScript/nativescript-cli.git","ssh_url":"git@github.com:NativeScript/nativescript-cli.git","clone_url":"https://github.com/NativeScript/nativescript-cli.git","svn_url":"https://github.com/NativeScript/nativescript-cli","homepage":"https://www.npmjs.com/package/nativescript","size":37761,"stargazers_count":457,"watchers_count":457,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":98,"forks":83,"open_issues":98,"watchers":457,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/2209"},"html":{"href":"https://github.com/NativeScript/nativescript-cli/pull/2209"},"issue":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/2209"},"comments":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/issues/2209/comments"},"review_comments":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/2209/comments"},"review_comment":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/pulls/2209/commits"},"statuses":{"href":"https://api.github.com/repos/NativeScript/nativescript-cli/statuses/6b73294319d13d0f6582901b05ec7fd90ab824af"}}}}
{"actor":{"display_login":"rosen-vladimirov"}}