NPM node-sass installation fails

node-sass npm
uninstall node-sass
npm rebuild node-sass
failed at the node-sass@4.12.0 postinstall script.
failed at the node-sass@4.13.1 postinstall script.
yarn add node-sass
sass vs node-sass
node-sass node 12

I am trying to install node-sass in a project, which perfectly builds and runs on my pc but on my surface I am having major issues when trying to install the packages.

Note: I have tryed reinstalling and rebuilding the project several times.

Summary of the error:

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Max-T\Documents\Sources\StaffMangerV2\black-dashboard-pro-react-v1.0.0\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Max-T\\Documents\\Sources\\StaffMangerV2\\black-dashboard-pro-react-v1.0.0\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\Max-T\Documents\Sources\StaffMangerV2\black-dashboard-pro-react-v1.0.0\node_modules\node-sass
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\react-scripts\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Max-T\AppData\Roaming\npm-cache\_logs\2019-10-30T10_05_01_386Z-debug.log

package.json => https://hastebin.com/azetegukes.pl too much coode so I had to paste it elsewhere.

You're using Node 12, and node-sass needs to be at lest 4.12 to support that version https://github.com/sass/node-sass#supported-nodejs-versions-vary-by-release-please-consult-the-releases-page-below-is-a-quick-guide-for-minimum-support

Can not install node-sass, I have an error when i run npm install node-sass, i have already the last versions of node and npm (LTS) and previously already installed npm  Exit status 8 npm ERR! npm ERR! Failed at the node-sass@2.0.0-beta install script. npm ERR! This is most likely a problem with the node-sass package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node scripts/install.js npm ERR! You can get their info via: npm ERR! npm owner ls node-sass npm ERR!

try this command it works for me

sudo npm install -g --unsafe-perm node-sass

Fail to install node-sass during npm install · Issue #2415 · sass/node , Fail to install node-sass during npm install #2415. Closed. connelevalsam opened this issue on Jun 13, 2018 · 13 comments. Closed  Failed at the node-sass@4.9.3 install script 'node scripts/install.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the node-sass package, npm ERR! not with npm itself. npm ERR!

After more than 2 hours of trying all sorts of ways (cleaning npm cache, deleting node_modules, trying to install with global switch -g, etc.) to install node-sass and failing every time, I finally changed the mirror to china and it immediately worked for me!! (I know it kinda doesn't make any sense, considering the error I was getting)

Just for reference, this was the error I was receiving before it finally worked:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\****\AppData\Roaming\npm-cache\_logs\2020-06-06T13_56_56_768Z-debug.log

My Node version: v12.18.0 node-sass version in package.json: "^4.14.0"

I changed the mirror as stated in the node-sass npm page.

npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install node-sass

Hope that helps.

node-sass, PS D:\demo> npm i node-sass > node-sass@4.13.0 install D:\demo\​node_modules\node-sass > node scripts/install.js Downloading binary  When Node-Sass fails Installing. So you're here because bash is outputting some big mess that looks like the following when you tried to install gulp-sass or node-sass via NPM. You've probably updated Node and NPM, switched versions in NVM or HomeBrew and are beating your head while node-sass isn't installing. The issue is likely not in the node or npm version but the package.json.

Why does node sass always fail to install?, js 4.x This usually happens because your environment has changed since running `npm install`. Run `npm rebuild node-sass` to build the binding for your  Recently, I’ve faced different issues when tryng npm install in some of the project I’ve been working with. Environment. Windows 10 (OS Build 15063.413) Node version: 8.1.2; NPM version: 5.0.3; Every time I tried npm install or install a isolated package I got errors like this one: Problem

Why are my builds failing with a node-sass error?, Learn to solve this npm error - Error: EACCES: permission denied, mkdir '/home/​todd/.npm-global/lib/node_modules/node-sass/vendor' The issue is caused because Node can’t find the Python path on your system.. Solution (optional) Install Python from the official website. Run the following command to install the Windows Build Tools using an elevated (Administrator) terminal window which installs the VS Build Tools and also Python 2.7:

Node-sass error during installation of node modules, sudo npm install --unsafe-perm -g node-sass. If this didn't solve your problem please open an issue with the output from our debugging script. npm install node-sass Some users have reported issues installing on Ubuntu due to node being registered to another package. Follow the official NodeJS docs to install NodeJS so that #!/usr/bin/env node correctly resolves. Compiling on Windows machines requires the node-gyp prerequisites.

Comments
  • Have you tried using yarn ? For most of the times yarn solved my problem for this.
  • Have you checked your npm config file? Is it correct because sometimes it gets corrupt and cause such issues. You can run npm run --config
  • @Mohit Tryed that, but the output seems fine to me => hastebin
  • @RehanSattar Also tryed that before and now again, with a complete error log => hastebin
  • Thanks, that actually fixed the installation bug, but I am still ending up with the same error in the browser => hastebin
  • That looks like a separate question
  • actually true ... so I will ask a new one.
  • I have no way to verify that at this point, but I hope it helps someone.