So you just upgraded NodeJS and expect, like everything else out there, that you will restart your app and everything will be fine. When you restart the app though you run into this nasty error about Node Sass: Error: Node Sass does not yet support your current environment
.
You sigh, question yourself for thinking an upgrade would FINALLY go smooth, check out Github and Google, and are probably a little perplexed at why no upgrade with JS can go easily. Luckily, the fix for this issue is usually very quick if you just installed a new version of node.
Run the following command:
npm rebuild node-sass
This command will reinstall the node-sass module updating the acceptable version of node to include your newly updated version. From there the command that caused the exception will run. The error thrown is due to the Node Sass moduleĀ maintaining the Node version that built it in the artifact generated. Therefore, every time you upgrade Node, rebuilding Node Sass is also required.
You can spend all day on Github and libraries will start blaming each other, but the reality is just a simple fix. I saw it once on an issue buried as the 200th comment and have kept it in my copy and paste set of commands since. This is one you definitely should add!