A npm dependency I am trying to install in a glitch node app is sails
which requires being installed with an npm version less than 3.
details
Sails supports npm >= 3 by copying the sails node_module into a sub folder. As sails and its dependencies are over 50 MB, you run out of diskspace on glitch when it copies. In npm < 3 symlinks are used instead which lets you create a project without running out of disk space on glitch.
I tried adding “npm”:"~2" to engines
in package.json but it does not look like it is respected.
I can npm i npm@2
and then add ./node_modules/.bin
to the path with PATH=./node_modules/.bin/:$PATH
and then tweak package.json to get npm install to run with the correct npm version, but that gets lost when the container spins down.
Is there a way to enforce an npm version to use and / or a way to have a start-up script that runs before dependencies are installed so I can modify the PATH
?