Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider --force option when reinstalling package #112

Open
Comandeer opened this issue Feb 10, 2018 · 0 comments
Open

Consider --force option when reinstalling package #112

Comandeer opened this issue Feb 10, 2018 · 0 comments

Comments

@Comandeer
Copy link

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 and my project, in which I encountered this issue):

Travis CI log
	Error: Command failed: npm install -D --save-prefix="^" @comandeer/[email protected]
	npm ERR! code ENOSELF
	npm ERR! Refusing to install package with name "@comandeer/rollup-lib-bundler" under a package
	npm ERR! also called "@comandeer/rollup-lib-bundler". Did you name your project the same
	npm ERR! as the dependency you're installing?
	npm ERR! 
	npm ERR! For more information, see:
	npm ERR!     <https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm>
	npm ERR! A complete log of this run can be found in:
	npm ERR!     /home/travis/.npm/_logs/2018-02-03T21_18_40_904Z-debug.log
	    at checkExecSyncError (child_process.js:601:13)
	    at execSync (child_process.js:641:13)
	    at updateLockfile (/home/travis/.nvm/versions/node/v8.9.4/lib/node_modules/greenkeeper-lockfile/lib/update-lockfile.js:44:7)
	    at Module.update [as exports] (/home/travis/.nvm/versions/node/v8.9.4/lib/node_modules/greenkeeper-lockfile/update.js:54:3)
	    at Object.<anonymous> (/home/travis/.nvm/versions/node/v8.9.4/lib/node_modules/greenkeeper-lockfile/update.js:62:37)
	    at Module._compile (module.js:643:30)
	    at Object.Module._extensions..js (module.js:654:10)
	    at Module.load (module.js:556:32)
	    at tryModuleLoad (module.js:499:12)
	    at Function.Module._load (module.js:491:3)

Addition of --force flag should be enough. It also should be safe in this context as greenkeeper just reinstalls already installed package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant