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

How to add npm prune in a hook before installing? #21

Open
binarykitchen opened this issue Feb 11, 2015 · 6 comments
Open

How to add npm prune in a hook before installing? #21

binarykitchen opened this issue Feb 11, 2015 · 6 comments

Comments

@binarykitchen
Copy link

Hello guys

With this plugin npm install is invoked when calling lein deps. How can I add a npm prune before npm install? Is there a hook for that I can add in the project.clj file?

@RyanMcG
Copy link
Owner

RyanMcG commented Jun 23, 2015

Mmmm, not that I am aware of. Can you run npm prune on its own? Is there a reason to not keep the commands separate?

@binarykitchen
Copy link
Author

never mind this one, i solved this within package.json:

  "scripts": {
    "preinstall": "npm prune",
  },

but unfortunately lein-npm does not honour existing package.json's when running lein deps ...

@RyanMcG
Copy link
Owner

RyanMcG commented Jun 23, 2015

Can you use :nodejs {:scripts {:preinstall "npm prune"}} in your project.clj instead?

The purpose of lein-npm is to produce a package.json so it makes sense to not use it. From the README:

You can execute npm commands that require the presence of a package.json file using the lein npm command.

Does that help?

@binarykitchen
Copy link
Author

Yeah, I could. I just do not want to move this to project.clj because we are using pm2 for deployment and it requires package.json to exist permanently.

@RyanMcG
Copy link
Owner

RyanMcG commented Aug 14, 2015

Would #35 help? I'd appreciate your input.

@binarykitchen
Copy link
Author

i am afraid i cannot help because i do not understand clojure :/

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

2 participants