npm install: Failed at the [email protected] postinstall script

If you run into this issue, read this page: https://www.bramvandenbulcke.be/en/kb/failed-node-sass3131-postinstall-script The solution in my case: 1) Delete the package-lock.json file 2) npm install gulp-sass –save-dev 3) npm install node-sass@latest Version specific notes: [email protected] runs only on versions of Node.js up to v7 as stated in the release notes:

Is node-sass a dev or a production dependency on React projects?

Since it’s required to do a production build, it should be in the production dependencies list imho. In my experience, most of the time the project gets build afresh for production, so needs all the packages required to build from scratch. A dev dependency might something like webpack-dev-server which isn’t needed for a prod build, … Read more

The opacity value was changed to 1% after building the Reacjs project

This issue has been reported in create-react-app and optimize-css-assets-webpack-plugin. https://github.com/facebook/create-react-app/issues/7980 https://github.com/NMFR/optimize-css-assets-webpack-plugin/issues/118 It appears the bug has been fixed, but the latest released version does not have the fix. I’ve fixed the problem by changing my opacity values from nn% to 0.nn values (e.g. 70% becomes 0.7).

Minify CSS with Node-sass

In the node-sass documentation says you have to use –output-style, and it could be nested | expanded | compact | compressed. To minify use compressed For example: node-sass -w public/css/scss/style.scss public/css/style.css –output-style compressed will minify the CSS.