How to avoid using install scripts for local development? #3025

domenic opened this Issue Dec 29, 2012 · 2 comments


None yet

3 participants

domenic commented Dec 29, 2012

So I have a package, widgetA. And another package, mainApp. These are entirely for local development and will never be published to npm.

widgetA contains Stylus, which needs to get compiled to CSS before mainApp sees it. At first I thought, oh, I'll use a "postinstall" script! But then I reflected on recent events and changed it to "prepublish". That should work great, right?

Then I went to actually carry out my workflow:

$ cd /path/to/projectRoot
$ cd widgetA
$ npm link
$ cd ../mainApp
$ npm link widgetA
$ npm install

Unfortunately, my "prepublish" script for widgetA was never run!

Even worse, when I changed to "postinstall", it was run!

So what's a locally-developing developer, who doesn't like antipatterns, to do?

isaacs commented Dec 29, 2012

Yes, this is a bug. link should run prepublish.

Workaround for now: cd /path/to/projectRoot/widgetA; npm install

timoxley commented Jan 7, 2014

@domenic npm link runs the prepublish script now, looks like this can be closed?


@domenic domenic closed this Feb 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment