brain.js icon indicating copy to clipboard operation
brain.js copied to clipboard

Node gyp error

Open BasToTheMax opened this issue 2 years ago • 4 comments

What is wrong?

Installing fails

Where does it happen?

logs: npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm ERR! code 1 npm ERR! path /root/node_modules/gl npm ERR! command failed npm ERR! command sh -c -- prebuild-install || node-gyp rebuild npm ERR! make: Entering directory '/root/node_modules/gl/build' npm ERR! CXX(target) Release/obj.target/angle_common/angle/src/common/Float16ToFloat32.o npm ERR! CXX(target) Release/obj.target/angle_common/angle/src/common/MemoryBuffer.o npm ERR! CXX(target) Release/obj.target/angle_common/angle/src/common/angleutils.o npm ERR! CXX(target) Release/obj.target/angle_common/angle/src/common/debug.o npm ERR! CXX(target) Release/obj.target/angle_common/angle/src/common/mathutil.o npm ERR! CXX(target) Release/obj.target/angle_common/angle/src/common/string_utils.o npm ERR! CXX(target) Release/obj.target/angle_common/angle/src/common/tls.o npm ERR! CXX(target) Release/obj.target/angle_common/angle/src/common/utilities.o npm ERR! AR(target) Release/obj.target/angle/src/angle_common.a npm ERR! COPY Release/angle_common.a npm ERR! COPY Release/obj/gen/angle/id/commit.h npm ERR! TOUCH Release/obj.target/angle/src/commit_id.stamp npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/common/event_tracer.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/AttributeMap.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Buffer.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Caps.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Compiler.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Config.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Context.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Data.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Debug.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Device.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Display.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Error.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Fence.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/Framebuffer.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/FramebufferAttachment.o npm ERR! CXX(target) Release/obj.target/libANGLE/angle/src/libANGLE/HandleAllocator.o npm ERR! make: Leaving directory '/root/node_modules/gl/build' npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using [email protected] npm ERR! gyp info using [email protected] | linux | x64 npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3" npm ERR! (node:5965) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only. npm ERR! (Use node --trace-deprecation ... to show where the warning was created) npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/root/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/root/node_modules/gl/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/root/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/root/.cache/node-gyp/16.18.0/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.18.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/root/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.18.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/root/node_modules/gl', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! ../angle/src/libANGLE/HandleAllocator.cpp: In constructor 'gl::HandleAllocator::HandleAllocator()': npm ERR! ../angle/src/libANGLE/HandleAllocator.cpp:29:52: error: 'numeric_limits' is not a member of 'std' npm ERR! 29 | mUnallocatedList.push_back(HandleRange(1, std::numeric_limits<GLuint>::max())); npm ERR! | ^~~~~~~~~~~~~~ npm ERR! ../angle/src/libANGLE/HandleAllocator.cpp:29:76: error: '::max' has not been declared; did you mean 'std::max'? npm ERR! 29 | mUnallocatedList.push_back(HandleRange(1, std::numeric_limits<GLuint>::max())); npm ERR! | ^~~ npm ERR! | std::max npm ERR! In file included from /usr/include/c++/11/algorithm:62, npm ERR! from ../angle/src/libANGLE/HandleAllocator.cpp:12: npm ERR! /usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here npm ERR! 3467 | max(initializer_list<_Tp> __l, _Compare __comp) npm ERR! | ^~~ npm ERR! ../angle/src/libANGLE/HandleAllocator.cpp:29:43: error: expected primary-expression before '(' token npm ERR! 29 | mUnallocatedList.push_back(HandleRange(1, std::numeric_limits<GLuint>::max())); npm ERR! | ^ npm ERR! ../angle/src/libANGLE/HandleAllocator.cpp:29:52: error: 'numeric_limits' is not a member of 'std' npm ERR! 29 | mUnallocatedList.push_back(HandleRange(1, std::numeric_limits<GLuint>::max())); npm ERR! | ^~~~~~~~~~~~~~ npm ERR! ../angle/src/libANGLE/HandleAllocator.cpp:29:73: error: expected primary-expression before '>' token npm ERR! 29 | mUnallocatedList.push_back(HandleRange(1, std::numeric_limits<GLuint>::max())); npm ERR! | ^ npm ERR! ../angle/src/libANGLE/HandleAllocator.cpp:29:76: error: '::max' has not been declared; did you mean 'std::max'? npm ERR! 29 | mUnallocatedList.push_back(HandleRange(1, std::numeric_limits<GLuint>::max())); npm ERR! | ^~~ npm ERR! | std::max npm ERR! In file included from /usr/include/c++/11/algorithm:62, npm ERR! from ../angle/src/libANGLE/HandleAllocator.cpp:12: npm ERR! /usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here npm ERR! 3467 | max(initializer_list<_Tp> __l, _Compare __comp) npm ERR! | ^~~ npm ERR! make: *** [angle/src/libANGLE.target.mk:241: Release/obj.target/libANGLE/angle/src/libANGLE/HandleAllocator.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 (/root/node_modules/node-gyp/lib/build.js:194:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) npm ERR! gyp ERR! System Linux 5.4.0-126-generic npm ERR! gyp ERR! command "/usr/bin/node" "/root/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /root/node_modules/gl npm ERR! gyp ERR! node -v v16.18.0 npm ERR! gyp ERR! node-gyp -v v7.1.2 npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-10-25T07_47_53_599Z-debug-0.log

How do we replicate the issue?

  1. npm i brain.js --save

Expected behavior (i.e. solution)

It should install

Version information

Nodejs:

16

Browser:

none

Brain.js:

latest

How important is this (1-5)?

5

Other Comments

BasToTheMax avatar Oct 25 '22 07:10 BasToTheMax

I am having the same issue, macOS Big Sur here...

Marcelo-GG avatar Nov 02 '22 20:11 Marcelo-GG

Since it looks like you are having the same issue as me, you can check how I fixed it on my machine. #853

armingdev avatar Nov 05 '22 14:11 armingdev

This looks like a duplicate of: https://github.com/BrainJS/brain.js/issues/853

Like I said there, if you export this environment variable before running "npm install", it should fix your problem.

Vectorrent avatar Nov 13 '22 12:11 Vectorrent

Thanks. I'll try that

BasToTheMax avatar Nov 13 '22 12:11 BasToTheMax