Node-Sass error while trying to install the dependencies of an Ionic 3 project

Asked

Viewed 973 times

0

Hello I have a project done in Ionic 3.2.0, the project in question can be found in the following link https://github.com/Mathe13/rodoviasApp, I downloaded it from git, removed the node_module and gave the npm i command to download the packages and had the following error:

/home/matheus/.node-gyp/12.7.0/include/node/v8.h:3002:5: note:   candidate expects 2 arguments, 1 provided
binding.target.mk:127: recipe for target 'Release/obj.target/binding/src/create_string.o' failed
make: *** [Release/obj.target/binding/src/create_string.o] Error 1
make: Leaving directory '/home/matheus/Documentos/ionic/rodoviasApp/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/matheus/Documentos/ionic/rodoviasApp/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.9.0-9-amd64
gyp ERR! command "/usr/bin/node" "/home/matheus/Documentos/ionic/rodoviasApp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/matheus/Documentos/ionic/rodoviasApp/node_modules/node-sass
gyp ERR! node -v v12.7.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN [email protected] requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /home/matheus/.npm/_logs/2019-07-25T00_57_44_503Z-debug.log

when looking at the log file I found the following message:

Error: [email protected] postinstall: `node scripts/build.js`

My operating system is Debian 9.9 stretch

The output of 'Node -v' is v12.7.0

Does anyone know how to solve it? If you need more data I will update the question

  • Try an "npm rebuild Node-Sass".

  • makes the same mistake

  • Use version 10.16.0 of Nodejs. 12.7.0 is very recent and not recommended for all projects.

1 answer

1


Following those guidelines, it worked for me:

  • Excluding the package-lock.json
  • Delete the folder node_modules
  • Spin npm install again

Browser other questions tagged

You are not signed in. Login or sign up in order to post.