I try to install node_modules for my angular project an I get issue for node-sass I use mac os, node js version -> v16.13.2, node-sass version in project ->^4.14.1 In this image1 and image2 is package.json The error that I get is :
npm ERR! 1 warning and 1 error generated.
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (../node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" ".../node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd .../node_modules/node-sass
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! .../.npm/_logs/2022-01-25T10_04_49_137Z-debug-0.log
I tied this commands npm install -g node-sass, npm uninstall -g node-sass The same I tried to install latest version of node-sass
CodePudding user response:
You might want to run npm upgrade
to have npm check for outdated version of your dependencies.
Because for node 16 you need node-sass in version 6.0
CodePudding user response:
Just remove node-sass from your package.json ... that solved the problem for me
CodePudding user response:
Try doing so, it worked from. You need to remove it from package.json
with one the blocks below.
If you are using npm
and that node-sass
is in your dependencies
:
npm uninstall node-sass --save
npm install node-sass --save
If you are using npm
and that node-sass
is in your devDependencies
:
npm uninstall node-sass --save-dev
npm install node-sass --save-dev
If you are using yarn
and that node-sass
is in your dependencies
:
yarn remove node-sass --save
yarn add node-sass --save
If you are using yarn
and that node-sass
is in your devDependencies
:
yarn remove node-sass --save-dev
yarn add node-sass --save-dev