How to fix 'Node Sass could not find a binding in your current env.' when running npm run build
This is due to a mismatch between the version of node used in your project and what you have globally installed.
- Review the version of node indicated in your project's package.json
- Change the version to the desired version of node
- Clear the project's node_modules folder by doing
npm clean-install
within your project directory - Issue
npm install
to install all packages again - Use:
node -v
to determine which version of node you have active. If the version outputted matches the version you set in the project yournpm run build
command will work. If they don't match you will either have to install the matching version of node or if you are using nvm use the:nvm use <version>
to active the matching version.
try the command: sudo npm install --save-dev --unsafe-perm node-sass
it works for me