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

is bower-installer supported? postinstall will not run when dependencies extracted from cache #15

Open
akleiber opened this issue Sep 1, 2015 · 6 comments

Comments

@akleiber
Copy link

akleiber commented Sep 1, 2015

Hi,

I have a package.json with a postinstall script to run bower-installer.
When I use npm-cache the postinstall script is not run and bower dependencies are missing.
I need bower-installer to move/rename some files from bower packages. So using bower is not an option.

package.json

{
  "name": "my-package",
  "private": true,
  "version": "0.1.0",
  "repository": {
    "type": "git",
    "url": "http://github.com/some/repo.git"
  },
  "dependencies": {
    "bower-installer": "git+ssh://[email protected]:rebuy-de/bower-installer.git#master"
  },
  "scripts": {
    "postinstall": "node_modules/bower-installer/bower-installer.js"
  }
}

The project is in two different folders due to some concurrency issues with our automatic and manual deployment.
So when npm-cache is run from folder 1 everything is fine. When run from folder 2 it uses the cached files, but there the bower dependencies from bower-installer are missing.

Is there a possibility to force run postinstall scripts from the package.json?
Am I doing it wrong?

@swarajban
Copy link
Owner

You're not doing it wrong, there is a problem with npm-cache. Right now, when running npm-cache install, I check to see if we have a cached version, and if we do, I simply unpack the cached dependency directories. I never run any of the pre-install or post-install scripts for node if I have a cached version. Good catch, will try to get to this issue soon

@akleiber
Copy link
Author

akleiber commented Sep 3, 2015

nice, thx :-)

@dfreudenberger
Copy link

any updates on this?

@swarajban
Copy link
Owner

Have not had a chance to look into this yet, sorry

@sudhirbits
Copy link

@dfreudenberger, have you considered https://www.npmjs.com/package/local-npm?
I use it for my build servers on which there is a npm registry running locally using local-npm

@swarajban
Copy link
Owner

Happy to accept a PR for this, not sure if I'll get to it in a reasonable amount of time

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

4 participants