{"action":"opened","issue":{"url":"https://api.github.com/repos/greenkeeperio/greenkeeper-lockfile/issues/112","repository_url":"https://api.github.com/repos/greenkeeperio/greenkeeper-lockfile","labels_url":"https://api.github.com/repos/greenkeeperio/greenkeeper-lockfile/issues/112/labels{/name}","comments_url":"https://api.github.com/repos/greenkeeperio/greenkeeper-lockfile/issues/112/comments","events_url":"https://api.github.com/repos/greenkeeperio/greenkeeper-lockfile/issues/112/events","html_url":"https://github.com/greenkeeperio/greenkeeper-lockfile/issues/112","id":296134466,"number":112,"title":"Consider --force option when reinstalling package","user":{"login":"Comandeer","id":1078728,"avatar_url":"https://avatars3.githubusercontent.com/u/1078728?v=4","gravatar_id":"","url":"https://api.github.com/users/Comandeer","html_url":"https://github.com/Comandeer","followers_url":"https://api.github.com/users/Comandeer/followers","following_url":"https://api.github.com/users/Comandeer/following{/other_user}","gists_url":"https://api.github.com/users/Comandeer/gists{/gist_id}","starred_url":"https://api.github.com/users/Comandeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Comandeer/subscriptions","organizations_url":"https://api.github.com/users/Comandeer/orgs","repos_url":"https://api.github.com/users/Comandeer/repos","events_url":"https://api.github.com/users/Comandeer/events{/privacy}","received_events_url":"https://api.github.com/users/Comandeer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-10T21:14:19Z","updated_at":"2018-02-10T21:14:19Z","closed_at":null,"author_association":"NONE","body":"Current version of `updateLockFile` function calls `npm install` without `--force` flag. Such method fails when package is a dev-dependency of itself (e.g. bundler, which bundles itself; it's the case with [rollup](https://github.com/rollup/rollup/blob/master/package.json#L78) and [my project](https://github.com/Comandeer/rollup-lib-bundler/blob/master/package.json#L75), in which I encountered this issue):\r\n<details><summary><a href=\"https://travis-ci.org/Comandeer/rollup-lib-bundler/jobs/337040768#L1406-L1427\">Travis CI log</a></summary>\r\n\r\n\t\tError: Command failed: npm install -D --save-prefix=\"^\" @comandeer/rollup-lib-bundler@0.4.0\r\n\t\tnpm ERR! code ENOSELF\r\n\t\tnpm ERR! Refusing to install package with name \"@comandeer/rollup-lib-bundler\" under a package\r\n\t\tnpm ERR! also called \"@comandeer/rollup-lib-bundler\". Did you name your project the same\r\n\t\tnpm ERR! as the dependency you're installing?\r\n\t\tnpm ERR! \r\n\t\tnpm ERR! For more information, see:\r\n\t\tnpm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>\r\n\t\tnpm ERR! A complete log of this run can be found in:\r\n\t\tnpm ERR!     /home/travis/.npm/_logs/2018-02-03T21_18_40_904Z-debug.log\r\n\t\t    at checkExecSyncError (child_process.js:601:13)\r\n\t\t    at execSync (child_process.js:641:13)\r\n\t\t    at updateLockfile (/home/travis/.nvm/versions/node/v8.9.4/lib/node_modules/greenkeeper-lockfile/lib/update-lockfile.js:44:7)\r\n\t\t    at Module.update [as exports] (/home/travis/.nvm/versions/node/v8.9.4/lib/node_modules/greenkeeper-lockfile/update.js:54:3)\r\n\t\t    at Object.<anonymous> (/home/travis/.nvm/versions/node/v8.9.4/lib/node_modules/greenkeeper-lockfile/update.js:62:37)\r\n\t\t    at Module._compile (module.js:643:30)\r\n\t\t    at Object.Module._extensions..js (module.js:654:10)\r\n\t\t    at Module.load (module.js:556:32)\r\n\t\t    at tryModuleLoad (module.js:499:12)\r\n\t\t    at Function.Module._load (module.js:491:3)\r\n\r\n</details>\r\n\r\nAddition of `--force` flag should be enough. It also should be safe in this context as greenkeeper just reinstalls already installed package."}}
{"actor":{"display_login":"Comandeer"}}