How to run script before all other scripts


(Eric Majerus) #1

I support several different node applications, with different node versions being used in production. So, I need to always be sure I’m using the node version in production for any particular application. I was hoping to define a npm script that is executed automatically before other npm scripts but there’s only a small handful available and seemingly no way to do it before any custom npm script.

I thought “npm hook scripts” would work, but this appears to not run for my own application.

Short of starting every custom npm script with “npm run set-node-version” or something, are there any options?


(system) #2

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.