I am running OSX 10.11.1 and trying to npm install
a project that contains a node-sass dependency in the package.json:
"dependencies": { "node-sass": "^3.4.2" }
I am running NPM version 2.14.7 and node version 4.2.3. When I run npm install
or npm rebuild node-sass
I get the following error output:
> [email protected] postinstall /Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass > node scripts/build.js gyp: /Users/markroper/.node-gyp/4.2.3/common.gypi not found (cwd: /Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass) while reading includes of binding.gyp while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/lib/configure.js:346:16) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Darwin 15.0.0 gyp ERR! command "/usr/local/bin/node" "/Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/bin/node-gyp" "rebuild" gyp ERR! cwd /Users/markroper/code/mktg/node_modules/gulp-sass/node_modules/node-sass gyp ERR! node -v v4.2.3 gyp ERR! pangyp -v v2.3.3 gyp ERR! not ok Build failed
Has anyone worked around this error with these versions?
node-sass not compatible with newer versions of node, such as 14 and 16.
When you change the version of Node. js used on your project, then the binding needs to be rebuild so that node-sass can be imported and executed from your code. Once the rebuild is finished, run the project again. Once done, you should be able to run the project without any errors.
Sass, Webpack, PostCSS, Compass, and Animate. css are the most popular alternatives and competitors to node-sass.
Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.
Add --unsafe-perm flag while installing
For linux/mac
sudo npm install --unsafe-perm -g node-sass
For windows environment , hit same command removing sudo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With