Search code examples
node.jsnpmv8gyp

Change PATH for npm installs


Is it possible to run a pre-script before the install of a package's dependencies? I need to change the environment slightly before install of any of my package's dependencies, because my Python version is 3.3 and node-gyp (via gyp) breaks if the default Python version is not a 2.x version.

Is there a hook in this install step I could use to do this?


Solution

  • I found the solution to be a project-level .npmrc with the contents

    python=python2.7