You are not logged in.

#1 2021-05-08 14:31:26

Spheerys
Member
Registered: 2012-05-01
Posts: 90

[nodejs] node-gyp error

Hi,

I have an error during npm install on a project directory :

4193 error gyp verb node dev dir /home/hedy/.node-gyp/16.1.0
4193 error gyp verb `which` succeeded for `make` /usr/bin/make
4193 error gyp info spawn make
4193 error gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
4193 error ../src/libsass/src/cencode.c: Dans la fonction « base64_encode_block »:
4193 error ../src/libsass/src/cencode.c:48:11: attention: cette instruction peut poursuivre son chemin [-Wimplicit-fallthrough=]
4193 error    48 |    result = (fragment & 0x003) << 4;
4193 error       |    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
4193 error ../src/libsass/src/cencode.c:52:2: note: ici
4193 error    52 |  case step_B:
4193 error       |  ^~~~
4193 error ../src/libsass/src/cencode.c:62:11: attention: cette instruction peut poursuivre son chemin [-Wimplicit-fallthrough=]
4193 error    62 |    result = (fragment & 0x00f) << 2;
4193 error       |    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
4193 error ../src/libsass/src/cencode.c:66:2: note: ici
4193 error    66 |  case step_C:
4193 error       |  ^~~~
4193 error ../src/libsass/src/functions.cpp: Dans la fonction « void Sass::Functions::handle_utf8_error(const Sass::ParserState&, Sass::Backtraces) »:
4193 error ../src/libsass/src/functions.cpp:110:20: attention: interception du type polymorphique « class utf8::invalid_code_point » par valeur [-Wcatch-value=]
4193 error   110 |       catch (utf8::invalid_code_point) {
4193 error       |                    ^~~~~~~~~~~~~~~~~~
4193 error ../src/libsass/src/functions.cpp:114:20: attention: interception du type polymorphique « class utf8::not_enough_room » par valeur [-Wcatch-value=]
4193 error   114 |       catch (utf8::not_enough_room) {
4193 error       |                    ^~~~~~~~~~~~~~~
4193 error ../src/libsass/src/functions.cpp:118:20: attention: interception du type polymorphique « class utf8::invalid_utf8 » par valeur [-Wcatch-value=]
4193 error   118 |       catch (utf8::invalid_utf8) {
4193 error       |                    ^~~~~~~~~~~~
4193 error ../src/libsass/src/json.cpp: Dans la fonction « char* json_encode_string(const char*) »:
4193 error ../src/libsass/src/json.cpp:405:15: attention: interception du type polymorphique « class std::exception » par valeur [-Wcatch-value=]
4193 error   405 |   catch (std::exception) {
4193 error       |               ^~~~~~~~~
4193 error ../src/libsass/src/json.cpp: Dans la fonction « char* json_stringify(const JsonNode*, const char*) »:
4193 error ../src/libsass/src/json.cpp:424:15: attention: interception du type polymorphique « class std::exception » par valeur [-Wcatch-value=]
4193 error   424 |   catch (std::exception) {
4193 error       |               ^~~~~~~~~
4193 error Dans le fichier inclus depuis /home/hedy/.node-gyp/16.1.0/include/node/v8.h:30,
4193 error                  depuis /home/hedy/.node-gyp/16.1.0/include/node/node.h:63,
4193 error                  depuis ../../nan/nan.h:56,
4193 error                  depuis ../src/binding.cpp:1:
4193 error /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h: Dans la fonction « void v8::internal::PerformCastCheck(T*) »:
4193 error /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h:452:38: erreur: « remove_cv_t » n'est pas un membre de « std »; vouliez-vous employer « remove_cv » ?
4193 error   452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
4193 error       |                                      ^~~~~~~~~~~
4193 error       |                                      remove_cv
4193 error /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h:452:38: erreur: « remove_cv_t » n'est pas un membre de « std »; vouliez-vous employer « remove_cv » ?
4193 error   452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
4193 error       |                                      ^~~~~~~~~~~
4193 error       |                                      remove_cv
4193 error /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h:452:50: erreur: l'argument 2 du patron est invalide
4193 error   452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
4193 error       |                                                  ^
4193 error /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h:452:63: erreur: « ::Perform » n'a pas été déclaré
4193 error   452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
4193 error       |                                                               ^~~~~~~
4193 error ../src/binding.cpp: Dans la fonction « Nan::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE) »:
4193 error ../src/binding.cpp:284:80: attention: transtypage entre types de fonctions incompatibles de « void (*)(uv_work_t*) » {aka « void (*)(uv_work_s*) »} vers « uv_after_work_cb » {aka « void (*)(uv_work_s*, int) »} [-Wcast-function-type]
4193 error   284 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
4193 error       |                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4193 error ../src/binding.cpp: Dans la fonction « Nan::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE) »:
4193 error ../src/binding.cpp:320:80: attention: transtypage entre types de fonctions incompatibles de « void (*)(uv_work_t*) » {aka « void (*)(uv_work_s*) »} vers « uv_after_work_cb » {aka « void (*)(uv_work_s*, int) »} [-Wcast-function-type]
4193 error   320 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
4193 error       |                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4193 error Dans le fichier inclus depuis ../../nan/nan.h:56,
4193 error                  depuis ../src/binding.cpp:1:
4193 error ../src/binding.cpp: Au niveau global:
4193 error /home/hedy/.node-gyp/16.1.0/include/node/node.h:806:7: attention: transtypage entre types de fonctions incompatibles de « void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE) » {aka « void (*)(v8::Local<v8::Object>) »} vers « node::addon_register_func » {aka « void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*) »} [-Wcast-function-type]
4193 error   806 |       (node::addon_register_func) (regfunc),                          \
4193 error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4193 error /home/hedy/.node-gyp/16.1.0/include/node/node.h:840:3: note: dans l'expansion de la macro « NODE_MODULE_X »
4193 error   840 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
4193 error       |   ^~~~~~~~~~~~~
4193 error ../src/binding.cpp:358:1: note: dans l'expansion de la macro « NODE_MODULE »
4193 error   358 | NODE_MODULE(binding, RegisterModule);
4193 error       | ^~~~~~~~~~~
4193 error make: *** [binding.target.mk:129 : Release/obj.target/binding/src/binding.o] Erreur 1
4193 error gyp ERR! build error
4193 error gyp ERR! stack Error: `make` failed with exit code: 2
4193 error gyp ERR! stack     at ChildProcess.onExit (/home/hedy/Sites/domain.fr/node_modules/node-gyp/lib/build.js:262:23)
4193 error gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
4193 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
4193 error gyp ERR! System Linux 5.10.34-1-lts
4193 error gyp ERR! command "/usr/bin/node" "/home/hedy/Sites/domain.fr/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
4193 error gyp ERR! cwd /home/hedy/Sites/domain.fr/node_modules/node-sass
4193 error gyp ERR! node -v v16.1.0
4193 error gyp ERR! node-gyp -v v3.8.0
4193 error gyp ERR! not ok
4193 error Build failed with error code: 1
4194 verbose exit 1

The full log is here : https://pb.spheerys.fr/?fe1785ec29065f3 … Q1UnRpXyQN

I tried to remove node_modules directory, update the package but I always have this gyp error !
I never had an error like this...

Last edited by Spheerys (2021-05-08 14:39:40)

Offline

#2 2021-05-08 15:21:16

zpg443
Member
Registered: 2016-12-03
Posts: 292

Re: [nodejs] node-gyp error

The error may be related to python and when using pip to install python packages rather than from official repositories and the AUR. I think that is what caused my issue.

https://wiki.archlinux.org/title/python

Got the error when upgrading, then removed npm and node-gyp. No more upgrade error. I will eventually figure out why it broke. This is my best guess for now.

Found this article which is helpful:

https://unix.stackexchange.com/question … es-on-arch

Last edited by zpg443 (2021-05-08 15:57:50)

Offline

#3 2021-05-08 16:33:02

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,644

Re: [nodejs] node-gyp error

You might have conflicting versions of node-gyp. See if you have a version with npm by something like:

# npm -g list 

Uninstall that npm version and install the repository version to be consistent.

Offline

#4 2021-05-11 18:25:30

Spheerys
Member
Registered: 2012-05-01
Posts: 90

Re: [nodejs] node-gyp error

the result of npm -g list :

/usr/lib
├── gtop@1.1.0
├── gulp@4.0.2
├── localtunnel@2.0.0
├── node-gyp@8.0.0
├── npm-check-updates@7.0.1
├── npm@7.12.0
├── semver@7.3.5
└── yarn@1.22.10

I did a npm remove node-gyp and a yay -S node-gyp :

node-gyp

  Usage: node-gyp <command> [options]

  where <command> is one of:
    - build - Invokes `make` and builds the module
    - clean - Removes any generated build files and the "out" dir
    - configure - Generates a Makefile for the current module
    - rebuild - Runs "clean", "configure" and "build" all at once
    - install - Install node development files for the specified node version.
    - list - Prints a listing of the currently installed node development files
    - remove - Removes the node development files for the specified version

node-gyp@8.0.0  /usr/lib/node_modules/node-gyp
node@16.1.0

But during npm rebuild node-sass inside my project folder, I always get this error :

npm ERR!   806 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/hedy/.node-gyp/16.1.0/include/node/node.h:840:3: note: dans l'expansion de la macro « NODE_MODULE_X »
npm ERR!   840 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../src/binding.cpp:358:1: note: dans l'expansion de la macro « NODE_MODULE »
npm ERR!   358 | NODE_MODULE(binding, RegisterModule);
npm ERR!       | ^~~~~~~~~~~
npm ERR! make: *** [binding.target.mk:129 : Release/obj.target/binding/src/binding.o] Erreur 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 (/home/hedy/Sites/website.eu/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.10.35-1-lts
npm ERR! gyp ERR! command "/usr/bin/node" "/home/hedy/Sites/website.eu/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/hedy/Sites/website.eu/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.1.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok 
npm ERR! Build failed with error code: 1

I get the error inside 2 differents projects and I guess it's a global issue...

Offline

#5 2021-05-11 19:14:09

redgroot
Member
Registered: 2021-05-11
Posts: 3

Re: [nodejs] node-gyp error

Have you tried to google your problem? Please check this link https://github.com/nodejs/node-gyp/issu … -490034535

Offline

#6 2021-05-12 07:20:28

Spheerys
Member
Registered: 2012-05-01
Posts: 90

Re: [nodejs] node-gyp error

Yes I have googled a lot before posting and nothing works (it's also old thread and the node, npm and node-gyp version are not the same)
Here some results which can help to understand what is going wrong :

$ npm audit fix --force

npm WARN using --force Recommended protections disabled.
npm WARN audit Updating gulp-csscomb to 3.1.0,which is a SemVer major change.
npm WARN audit Updating gulp to 4.0.2,which is a SemVer major change.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

added 159 packages, removed 139 packages, changed 19 packages, and audited 861 packages in 14s

21 packages are looking for funding
  run `npm fund` for details

# npm audit report

minimatch  <=3.0.1
Severity: high
Regular Expression Denial of Service - https://npmjs.com/advisories/118
fix available via `npm audit fix --force`
Will install gulp-csscomb@0.1.0, which is a breaking change
node_modules/minimatch
  csscomb-core  *
  Depends on vulnerable versions of minimatch
  Depends on vulnerable versions of vow-fs
  node_modules/csscomb-core
    csscomb  3.0.0-1 - 3.0.4 || 3.1.5 - 3.1.8
    Depends on vulnerable versions of csscomb-core
    node_modules/csscomb
      gulp-csscomb  >=0.2.0
      Depends on vulnerable versions of csscomb
      node_modules/gulp-csscomb
  glob  3.0.0 - 5.0.14
  Depends on vulnerable versions of minimatch
  node_modules/vow-fs/node_modules/glob
    vow-fs  0.1.9 - 0.3.5
    Depends on vulnerable versions of glob
    Depends on vulnerable versions of node-uuid
    node_modules/vow-fs

node-uuid  <1.4.4
Insecure Entropy Source - Math.random() - https://npmjs.com/advisories/93
fix available via `npm audit fix --force`
Will install gulp-csscomb@0.1.0, which is a breaking change
node_modules/node-uuid
  vow-fs  0.1.9 - 0.3.5
  Depends on vulnerable versions of glob
  Depends on vulnerable versions of node-uuid
  node_modules/vow-fs
    csscomb-core  *
    Depends on vulnerable versions of minimatch
    Depends on vulnerable versions of vow-fs
    node_modules/csscomb-core
      csscomb  3.0.0-1 - 3.0.4 || 3.1.5 - 3.1.8
      Depends on vulnerable versions of csscomb-core
      node_modules/csscomb
        gulp-csscomb  >=0.2.0
        Depends on vulnerable versions of csscomb
        node_modules/gulp-csscomb

yargs-parser  <=13.1.1 || 14.0.0 - 15.0.0 || 16.0.0 - 18.1.1
Prototype Pollution - https://npmjs.com/advisories/1500
fix available via `npm audit fix --force`
Will install gulp@3.9.1, which is a breaking change
node_modules/gulp-cli/node_modules/yargs-parser
  yargs  4.0.0-alpha1 - 12.0.5 || 14.1.0 || 15.0.0 - 15.2.0
  Depends on vulnerable versions of yargs-parser
  node_modules/gulp-cli/node_modules/yargs
    gulp-cli  >=2.0.0
    Depends on vulnerable versions of yargs
    node_modules/gulp-cli
      gulp  >=4.0.0
      Depends on vulnerable versions of gulp-cli
      node_modules/gulp

11 vulnerabilities (5 low, 6 high)

To address all issues (including breaking changes), run:
  npm audit fix --force

I have installed with yay :
- npm 7.12.1-1
- node-gyp 8.0.0-1

node -v give v16. 1.0
npm -v give 7.12.0 (hummm why not 7.12.1 ???)
node-gyp give me :

node-gyp@8.0.0  /usr/lib/node_modules/node-gyp
node@16.1.0

I understand than is a packaged/version issue, but I don't know from where to begin...

Last edited by Spheerys (2021-05-12 07:23:45)

Offline

#7 2021-05-12 07:50:43

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,644

Re: [nodejs] node-gyp error

I understand than is a packaged/version issue, but I don't know from where to begin...

Yes as I mentioned in my earlier post you have conflicting versions. I suggest first uninstall the npm and node-gyp pacman packages. (Pacman will probably flag dependencies but for now just do a pacman -Rdd since you will install it again). Then run:

npm -g uninstall node-gyp
npm -g uninstall npm

Prepend sudo if your npm installation is systemwide.

Once those are uninstalled, you also have the option to clean up removing ~/.npm and ~/,config/node-gyp and other caches you have in your home directory but this is your call if you want a clean reset.
Then reinstall the pacman npm and node-gyp packages.

Offline

#8 2021-05-12 08:56:48

Spheerys
Member
Registered: 2012-05-01
Posts: 90

Re: [nodejs] node-gyp error

I did all your recommendations without success sad
Or maybe I missed something.
What I did :

* first I did npm -g uninstall node-gyp because if I remove npm defore by pacman, I can't do it !
* after I did a sudo pacman -Rdd npm node-gyp
* npm -g uninstall npm doesn't work because npm was uninstalled with pacman (unknow command)
* finally I do rm -Rf ~/.npm ~/.node-gyp

And after all, I do a pacman -S npm node-gyp
Inside my project directory :

* I have removed the directory ./node_modules/
* I did npm install

And I always get this fu**** error :

npm ERR! ../src/libsass/src/functions.cpp: Dans la fonction « void Sass::Functions::handle_utf8_error(const Sass::ParserState&, Sass::Backtraces) »:
npm ERR! ../src/libsass/src/functions.cpp:110:20: attention: interception du type polymorphique « class utf8::invalid_code_point » par valeur [-Wcatch-value=]
npm ERR!   110 |       catch (utf8::invalid_code_point) {
npm ERR!       |                    ^~~~~~~~~~~~~~~~~~
npm ERR! ../src/libsass/src/functions.cpp:114:20: attention: interception du type polymorphique « class utf8::not_enough_room » par valeur [-Wcatch-value=]
npm ERR!   114 |       catch (utf8::not_enough_room) {
npm ERR!       |                    ^~~~~~~~~~~~~~~
npm ERR! ../src/libsass/src/functions.cpp:118:20: attention: interception du type polymorphique « class utf8::invalid_utf8 » par valeur [-Wcatch-value=]
npm ERR!   118 |       catch (utf8::invalid_utf8) {
npm ERR!       |                    ^~~~~~~~~~~~
npm ERR! ../src/libsass/src/json.cpp: Dans la fonction « char* json_encode_string(const char*) »:
npm ERR! ../src/libsass/src/json.cpp:405:15: attention: interception du type polymorphique « class std::exception » par valeur [-Wcatch-value=]
npm ERR!   405 |   catch (std::exception) {
npm ERR!       |               ^~~~~~~~~
npm ERR! ../src/libsass/src/json.cpp: Dans la fonction « char* json_stringify(const JsonNode*, const char*) »:
npm ERR! ../src/libsass/src/json.cpp:424:15: attention: interception du type polymorphique « class std::exception » par valeur [-Wcatch-value=]
npm ERR!   424 |   catch (std::exception) {
npm ERR!       |               ^~~~~~~~~
npm ERR! Dans le fichier inclus depuis /home/hedy/.node-gyp/16.1.0/include/node/v8.h:30,
npm ERR!                  depuis /home/hedy/.node-gyp/16.1.0/include/node/node.h:63,
npm ERR!                  depuis ../../nan/nan.h:56,
npm ERR!                  depuis ../src/binding.cpp:1:
npm ERR! /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h: Dans la fonction « void v8::internal::PerformCastCheck(T*) »:
npm ERR! /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h:452:38: erreur: « remove_cv_t » n'est pas un membre de « std »; vouliez-vous employer « remove_cv » ?
npm ERR!   452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR!       |                                      ^~~~~~~~~~~
npm ERR!       |                                      remove_cv
npm ERR! /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h:452:38: erreur: « remove_cv_t » n'est pas un membre de « std »; vouliez-vous employer « remove_cv » ?
npm ERR!   452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR!       |                                      ^~~~~~~~~~~
npm ERR!       |                                      remove_cv
npm ERR! /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h:452:50: erreur: l'argument 2 du patron est invalide
npm ERR!   452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR!       |                                                  ^
npm ERR! /home/hedy/.node-gyp/16.1.0/include/node/v8-internal.h:452:63: erreur: « ::Perform » n'a pas été déclaré
npm ERR!   452 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR!       |                                                               ^~~~~~~
npm ERR! ../src/binding.cpp: Dans la fonction « Nan::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE) »:
npm ERR! ../src/binding.cpp:284:80: attention: transtypage entre types de fonctions incompatibles de « void (*)(uv_work_t*) » {aka « void (*)(uv_work_s*) »} vers « uv_after_work_cb » {aka « void (*)(uv_work_s*, int) »} [-Wcast-function-type]
npm ERR!   284 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
npm ERR!       |                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../src/binding.cpp: Dans la fonction « Nan::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE) »:
npm ERR! ../src/binding.cpp:320:80: attention: transtypage entre types de fonctions incompatibles de « void (*)(uv_work_t*) » {aka « void (*)(uv_work_s*) »} vers « uv_after_work_cb » {aka « void (*)(uv_work_s*, int) »} [-Wcast-function-type]
npm ERR!   320 |     int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
npm ERR!       |                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! Dans le fichier inclus depuis ../../nan/nan.h:56,
npm ERR!                  depuis ../src/binding.cpp:1:
npm ERR! ../src/binding.cpp: Au niveau global:
npm ERR! /home/hedy/.node-gyp/16.1.0/include/node/node.h:806:7: attention: transtypage entre types de fonctions incompatibles de « void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE) » {aka « void (*)(v8::Local<v8::Object>) »} vers « node::addon_register_func » {aka « void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*) »} [-Wcast-function-type]
npm ERR!   806 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/hedy/.node-gyp/16.1.0/include/node/node.h:840:3: note: dans l'expansion de la macro « NODE_MODULE_X »
npm ERR!   840 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../src/binding.cpp:358:1: note: dans l'expansion de la macro « NODE_MODULE »
npm ERR!   358 | NODE_MODULE(binding, RegisterModule);
npm ERR!       | ^~~~~~~~~~~
npm ERR! make: *** [binding.target.mk:129 : Release/obj.target/binding/src/binding.o] Erreur 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 (/home/hedy/Sites/website.eu/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.10.35-1-lts
npm ERR! gyp ERR! command "/usr/bin/node" "/home/hedy/Sites/website.eu/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/hedy/Sites/website.eu/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.1.0
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:

Last edited by Spheerys (2021-05-12 09:01:33)

Offline

#9 2021-05-12 09:32:36

lupo.lupov
Member
Registered: 2019-03-14
Posts: 7

Re: [nodejs] node-gyp error

Hi,

From your full log I see that you are trying to install "178 silly fetch manifest node-sass@^4.8.3"
Arch linux by default installs node 16 at the moment
If you go to node-sass github page https://github.com/sass/node-sass you'll see supported version (node => node-sass)

Your version is very very old - works only with node 8

So you have two options - update node-sass version in your package.json file to 6.0 or try to use some very old node via NVM

Usefull links:
https://wiki.archlinux.org/title/Node.js
https://aur.archlinux.org/packages/nvm/

Offline

#10 2021-05-12 10:20:08

Spheerys
Member
Registered: 2012-05-01
Posts: 90

Re: [nodejs] node-gyp error

I'm OK to use a more recent of node-sass.
the point is my package.json doesn't talk about node-sass :

{
  "name": "Project",
  "version": "1.0.0",
  "description": "project",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Spheerys",
  "license": "ISC",
  "devDependencies": {
    "breakpoint-sass": "^2.7.1",
    "browser-sync": "^2.26.13",
    "gulp": "^4.0.2",
    "gulp-autoprefixer": "^5.0.0",
    "gulp-clean-css": "^4.3.0",
    "gulp-connect-php": "^1.0.3",
    "gulp-cssbeautify": "^3.0.0",
    "gulp-csscomb": "^3.1.0",
    "gulp-csso": "^4.0.1",
    "gulp-if": "^3.0.0",
    "gulp-livereload": "^4.0.2",
    "gulp-load-plugins": "^2.0.5",
    "gulp-notify": "^3.2.0",
    "gulp-options": "^1.1.1",
    "gulp-plumber": "^1.2.1",
    "gulp-postcss": "^9.0.0",
    "gulp-rename": "^2.0.0",
    "gulp-sass": "^4.1.0",
    "gulp-sourcemaps": "^2.6.5",
    "gulp-touch-cmd": "0.0.1",
    "postcss-gap-properties": "^1.0.0"
  }
}

I'm also using npm-check-updates for updating my package.json file when I'm starting a new project.
I don't know why and where I have to mention node-sass
However, I'm always using sass on my projects...

Last edited by Spheerys (2021-05-12 10:21:22)

Offline

#11 2021-05-12 10:47:17

lupo.lupov
Member
Registered: 2019-03-14
Posts: 7

Re: [nodejs] node-gyp error

node-sass is dev dependency of breakpoint-sass https://www.npmjs.com/package/breakpoin … pendencies

Because it's only dev dependent, you can install it with "npm install --no-dev" instead of "npm install", but breakpoint-sass has no new release more than 4 years, so my opinion is that you should try to find some alternative of it

Offline

#12 2021-05-12 11:01:42

Spheerys
Member
Registered: 2012-05-01
Posts: 90

Re: [nodejs] node-gyp error

So I have modiffied my package.json file like this :

{
  "name": "project",
  "version": "1.0.0",
  "description": "project",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Spheerys",
  "license": "ISC",
  "devDependencies": {
    "node-sass": "^6.0.0",
    "browser-sync": "^2.26.13",
    "gulp": "^4.0.2",
    "gulp-autoprefixer": "^5.0.0",
    "gulp-clean-css": "^4.3.0",
    "gulp-connect-php": "^1.0.3",
    "gulp-cssbeautify": "^3.0.0",
    "gulp-csscomb": "^3.1.0",
    "gulp-csso": "^4.0.1",
    "gulp-if": "^3.0.0",
    "gulp-livereload": "^4.0.2",
    "gulp-load-plugins": "^2.0.5",
    "gulp-notify": "^3.2.0",
    "gulp-options": "^1.1.1",
    "gulp-plumber": "^1.2.1",
    "gulp-postcss": "^9.0.0",
    "gulp-rename": "^2.0.0",
    "gulp-sass": "^4.1.0",
    "gulp-sourcemaps": "^2.6.5",
    "gulp-touch-cmd": "0.0.1",
    "postcss-gap-properties": "^1.0.0"
  }
}

But when I run npm install, I still have the erreor.
You can have my last complete log here : https://pb.spheerys.fr/?343dc630115d855 … Rvt284S5A9

Offline

#13 2021-05-12 11:32:07

lupo.lupov
Member
Registered: 2019-03-14
Posts: 7

Re: [nodejs] node-gyp error

OK, you can do something else...

Uninstall node and npm and install LTS versions

pacman -Rsn node npm && pacman -S nodejs-lts-fermium npm6

And npm install again....

Offline

#14 2021-05-12 11:43:36

Spheerys
Member
Registered: 2012-05-01
Posts: 90

Re: [nodejs] node-gyp error

Yes that's work ! Thanks a lot for your patience !

But to be sure to understand : you ask me to retrograde npm from 7.12 to 6.14
On my use case, it doesn't matter a lot, but I understand the issue was coming after the update of npm and with something else.
In the Arch philosophy, I would prefer to be up to date if possible and I didn't understood what's going wrong on my configuration...
In the future, I will probably have to get npm 7.x version, no ?

Offline

#15 2021-05-12 11:55:03

redgroot
Member
Registered: 2021-05-11
Posts: 3

Re: [nodejs] node-gyp error

Spheerys wrote:

Yes that's work ! Thanks a lot for your patience !

But to be sure to understand : you ask me to retrograde npm from 7.12 to 6.14
On my use case, it doesn't matter a lot, but I understand the issue was coming after the update of npm and with something else.
In the Arch philosophy, I would prefer to be up to date if possible and I didn't understood what's going wrong on my configuration...
In the future, I will probably have to get npm 7.x version, no ?

Can you also try to use nvm if you have time? I wonder if that works.

nvm install --lts

Last edited by redgroot (2021-05-12 11:57:41)

Offline

#16 2021-05-12 12:02:16

Spheerys
Member
Registered: 2012-05-01
Posts: 90

Re: [nodejs] node-gyp error

I don't have to much time to test this for now, but I keep the tip for later !
Thanks again for your very very useful help !
I can go to make dev again !

Offline

Board footer

Powered by FluxBB