Closed turnerhayes closed 5 years ago
Also, is there a way to add a pre-... npm install
hook to make sure this happens for new folks right off?
That might be trickier, because it depends on nvm
being installed, and as far as I know there's not a good way to do that from a script--I think they will have to install nvm first (if they don't have it).
Maybe there's a way to detect if nvm
is installed and run the necessary commands only in that case?
Dang, forgot about that part. Hmm. Maybe a warning if they're using the wrong version of node/npm?
That can be done; the problem is that create-react-app
's start
script clears the console, so at most you'd see the warning appear for a couple of seconds and that might not be enough to register it.
I was actually thinking of doing it at other times. For example, when they first clone the repo, when they do npm install
, when they push. It seems like there's a lot of different options.
Test plan:
nvm install
from the project root directoryv10.13.0
)nvm use
node --version
)