Lorena C. Estrella R.
Lorena C. Estrella R.

Reputation: 45

Error: gyp ERR! build error on Macbook M3 Pro

when I run npm i on my project in nestjs, node 18, macbook M3 Pro computer with sonoma operating system I always get the same error:

npm http fetch GET 200 http://nexuscloud.banco.bestado.cl/repository/npm-group/pino/-/pino-7.11.0.tgz 19734ms (cache miss)
npm http fetch GET 200 http://nexuscloud.banco.bestado.cl/repository/npm-group/uuid/-/uuid-8.3.2.tgz 19745ms (cache miss)
npm http fetch GET 200 http://nexuscloud.banco.bestado.cl/repository/npm-group/regexp-clone/-/regexp-clone-1.0.0.tgz 20225ms attempt #2 (cache miss)
npm http fetch GET 200 http://nexuscloud.banco.bestado.cl/repository/npm-group/mongoose/-/mongoose-5.13.7.tgz 20037ms (cache miss)
npm http fetch GET 200 http://nexuscloud.banco.bestado.cl/repository/npm-group/node-rdkafka/-/node-rdkafka-2.15.0.tgz 20972ms (cache miss)
npm http fetch GET 200 http://nexuscloud.banco.bestado.cl/repository/npm-group/webpack/-/webpack-5.82.1.tgz 20948ms (cache miss)
npm http fetch GET 200 http://nexuscloud.banco.bestado.cl/repository/npm-group/typescript/-/typescript-4.9.5.tgz 34256ms (cache miss)
npm info run [email protected] install node_modules/fsevents node-gyp rebuild
npm info run [email protected] install node_modules/node-rdkafka node-gyp rebuild
npm info run [email protected] install { code: 1, signal: null }
npm verb reify failed optional dependency /Users/lorena/Documents/Celula Thanatos/nominas_pac/nomina-cargo-pac-pj-ms/node_modules/fsevents
npm info run [email protected] install { code: 1, signal: null }
npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/Users/lorena/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack     at ChildProcess.emit (node:events:513:28)
npm verb stack     at maybeClose (node:internal/child_process:1091:16)
npm verb stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm verb pkgid [email protected]
npm verb cwd /Users/lorena/Documents/Celula Thanatos/nominas_pac/nomina-cargo-pac-pj-ms
npm verb Darwin 23.1.0
npm verb node v18.16.0
npm verb npm  v9.5.1
npm ERR! code 1
npm ERR! path /Users/lorena/Documents/Celula Thanatos/nominas_pac/nomina-cargo-pac-pj-ms/node_modules/node-rdkafka
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! LD_LIBRARY_PATH=/Users/lorena/Documents/Celula Thanatos/nominas_pac/nomina-cargo-pac-pj-ms/node_modules/node-rdkafka/build/Release/lib.host:/Users/lorena/Documents/Celula Thanatos/nominas_pac/nomina-cargo-pac-pj-ms/node_modules/node-rdkafka/build/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps; mkdir -p librdkafka; node ../util/configure
npm ERR! Usage: ./configure [OPTIONS...]
npm ERR! mklove/modules/configure.base: line 1036: $MKL_OUTDBG: ambiguous redirect
npm ERR! Module libcurl not found (required by self)
npm ERR! mklove/modules/configure.base: line 1028: $MKL_OUTDBG: ambiguous redirect
npm ERR! downloading missing module parseversion from http://github.com/edenhill/mklove/raw/master/modules/configure.parseversion
npm ERR! mklove/modules/configure.base: line 1045: $MKL_OUTDBG: ambiguous redirect
npm ERR! Failed to download parseversion:
npm ERR! mklove/modules/configure.base: line 1028: $MKL_OUTDBG: ambiguous redirect
npm ERR! 
npm ERR! mklove/modules/configure.base: line 1036: $MKL_OUTDBG: ambiguous redirect
npm ERR! Module parseversion not found (required by self)
npm ERR! mklove/modules/configure.base: line 1028: $MKL_OUTDBG: ambiguous redirect
npm ERR! Unknown option prefix=/Users/lorena/Documents/Celula Thanatos/nominas_pac/nomina-cargo-pac-pj-ms/node_modules/node-rdkafka/build/deps
npm ERR! mklove/modules/configure.base: line 1028: $MKL_OUTDBG: ambiguous redirect
npm ERR! make: *** No rule to make target `../deps/librdkafka/config.h', needed by `11a9e3388a67e1ca5c31c1d8da49cb6d2714eb41.intermediate'.  Stop.
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 (/Users/lorena/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 23.1.0
npm ERR! gyp ERR! command "/Users/lorena/.nvm/versions/node/v18.16.0/bin/node" "/Users/lorena/.nvm/versions/node/v18.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/lorena/Documents/Celula Thanatos/nominas_pac/nomina-cargo-pac-pj-ms/node_modules/node-rdkafka
npm ERR! gyp ERR! node -v v18.16.0
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
npm verb exit 1
npm verb unfinished npm timer reify 1706666453281
npm verb unfinished npm timer reify:build 1706667165776
npm verb unfinished npm timer build 1706667165778
npm verb unfinished npm timer build:deps 1706667165778
npm verb unfinished npm timer build:run:install 1706667165803
npm verb unfinished npm timer build:run:install:node_modules/node-rdkafka 1706667165808
npm verb code 1

I have tried running the following commands to solve the problem:

However I keep getting the same error, anyone with a similar situation?

Upvotes: 1

Views: 1238

Answers (1)

ykit9
ykit9

Reputation: 493

You need to install supported version of Python for this to work. More info on documentation

Upvotes: 0

Related Questions