Node-gyp: "gyp ERR! This is a bug in `node-gyp`."

Created on 18 Sep 2018  路  9Comments  路  Source: nodejs/node-gyp

I got this error while running a yarn build, the output says it's a bug in node-gyp.

Another issue is that it exited with a 0 error code, I suppose that's an issue with yarn and not here? So the rest of my build script continued instead of failing.

  • Node Version: v10.10.0, yarn 1.9.4
  • Platform: 4.9.0-7-amd64 #1 SMP Debian 4.9.110-1 (2018-07-05) x86_64 GNU/Linux
  • Compiler:
    Using built-in specs.
    COLLECT_GCC=cc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Debian 6.3.0-18+deb9u1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)

Verbose output (from npm or node-gyp):


yarn install v1.9.4                                                                                                                                                                                                                                               
[1/4] Resolving packages...
[2/4] Fetching packages...
[------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0/216
(node:10986) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.                                                                                                       
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error .../node_modules/sharp: Command failed.
Exit code: 7
Command: node-gyp rebuild
Arguments:
Directory: .../node_modules/sharp
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn ENOMEM
gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:358:11)
gyp ERR! stack     at Object.spawn (child_process.js:533:9)
gyp ERR! stack     at Gyp.spawn (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:180:26)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:334:20
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:155:5)
gyp ERR! System Linux 4.9.0-7-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd .../node_modules/sharp
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Most helpful comment

Can someone explain to me why this got closed? I'm having a similar issue and I can definitely say it's not a memory issue.

All 9 comments

gyp ERR! stack Error: spawn ENOMEM

Not really a node-gyp bug. The system ran out of memory.

What about the exit code being 0 in the failure case?

Got the identical error on npm install. Makes no sense. This needs to be resolved. I have 32GB RAM, only 15% used.

Getting the same error. Definitely not out of memory.

Can someone explain to me why this got closed? I'm having a similar issue and I can definitely say it's not a memory issue.

Are you using [email protected] like the original post?

@cclauss yup!

Could you please retry with something a bit more modern?
https://github.com/nodejs/node-gyp/releases

@cclauss I would if I could. I found a workaround to the issue by getting an older version of node. node 10 specifically.

Was this page helpful?
0 / 5 - 0 ratings