{"action":"created","issue":{"url":"https://api.github.com/repos/koala-framework/composer-extra-assets/issues/5","labels_url":"https://api.github.com/repos/koala-framework/composer-extra-assets/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/koala-framework/composer-extra-assets/issues/5/comments","events_url":"https://api.github.com/repos/koala-framework/composer-extra-assets/issues/5/events","html_url":"https://github.com/koala-framework/composer-extra-assets/pull/5","id":60704555,"number":5,"title":"Delaying npm installation check","user":{"login":"moufmouf","id":1290952,"avatar_url":"https://avatars.githubusercontent.com/u/1290952?v=3","gravatar_id":"","url":"https://api.github.com/users/moufmouf","html_url":"https://github.com/moufmouf","followers_url":"https://api.github.com/users/moufmouf/followers","following_url":"https://api.github.com/users/moufmouf/following{/other_user}","gists_url":"https://api.github.com/users/moufmouf/gists{/gist_id}","starred_url":"https://api.github.com/users/moufmouf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moufmouf/subscriptions","organizations_url":"https://api.github.com/users/moufmouf/orgs","repos_url":"https://api.github.com/users/moufmouf/repos","events_url":"https://api.github.com/users/moufmouf/events{/privacy}","received_events_url":"https://api.github.com/users/moufmouf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-11T18:14:37Z","updated_at":"2015-03-12T15:52:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/koala-framework/composer-extra-assets/pulls/5","html_url":"https://github.com/koala-framework/composer-extra-assets/pull/5","diff_url":"https://github.com/koala-framework/composer-extra-assets/pull/5.diff","patch_url":"https://github.com/koala-framework/composer-extra-assets/pull/5.patch"},"body":"This is directly related to #4 .\r\n\r\nIn order to add the opportunity to install npm by other plugins (namely mouf/nodejs-installer), I moved the check on npm installation from the `activate` method to the `onPostUpdateInstall` method.\r\n\r\nThis is my test `composer.json` file:\r\n\r\n```\r\n{\r\n    \"require\": {\r\n        \"koala-framework/composer-extra-assets\": \"dev-master\",\r\n        \"mouf/nodejs-installer\": \"~1.0\",\r\n        \"composer/composer\": \"*\"\r\n    },\r\n    \"autoload\": {\r\n        \"psr-0\": {\"Test\": [\"src/\", \"src-dev/\", \"tests/\"]}\r\n    },\r\n    \"minimum-stability\": \"dev\",\r\n    \"extra\": {\r\n        \"require-npm\": {\r\n            \"grunt\": \"0.4.*\"\r\n        },\r\n        \"require-bower\": {\r\n            \"jquery\": \"*\"\r\n        },\r\n        \"require-dev-bower\": {\r\n            \"qunit\": \"*\"\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nWith the changes in this PR, this works nicely, even on a machine with no nodejs installed.\r\n\r\nNote: I updated the \"mouf/nodejs-installer\" so that it prepends *vendor/bin* to the PATH. Therefore, when *composer-extra-assets* is triggered, it loads node / npm from the *vendor/bin* directory automatically."},"comment":{"url":"https://api.github.com/repos/koala-framework/composer-extra-assets/issues/comments/78508245","html_url":"https://github.com/koala-framework/composer-extra-assets/pull/5#issuecomment-78508245","issue_url":"https://api.github.com/repos/koala-framework/composer-extra-assets/issues/5","id":78508245,"user":{"login":"nsams","id":50764,"avatar_url":"https://avatars.githubusercontent.com/u/50764?v=3","gravatar_id":"","url":"https://api.github.com/users/nsams","html_url":"https://github.com/nsams","followers_url":"https://api.github.com/users/nsams/followers","following_url":"https://api.github.com/users/nsams/following{/other_user}","gists_url":"https://api.github.com/users/nsams/gists{/gist_id}","starred_url":"https://api.github.com/users/nsams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsams/subscriptions","organizations_url":"https://api.github.com/users/nsams/orgs","repos_url":"https://api.github.com/users/nsams/repos","events_url":"https://api.github.com/users/nsams/events{/privacy}","received_events_url":"https://api.github.com/users/nsams/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T15:52:22Z","updated_at":"2015-03-12T15:52:22Z","body":"#6 removes the check completely. If that is merge we can close this PR."}}