Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
domenic opened this Issue · 2 comments

3 participants

@domenic
Collaborator

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
Owner

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

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

@timoxley
Collaborator

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

#4430

@domenic domenic closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.