introlab / odas_web

A desktop visualization GUI for the ODAS library
MIT License
145 stars 55 forks source link

npm install error #71

Open t11s opened 3 years ago

t11s commented 3 years ago

npm install error, Ubuntu 21.04 64-bit osboxes.org image on VirtualBox on Mac.

`Rebuild Failed

An unhandled error occurred inside electron-rebuild gyp info it worked if it ends with ok gyp info using node-gyp@4.0.0 gyp info using node@12.21.0 | linux | x64 gyp info spawn /usr/bin/python2 gyp info spawn args [ gyp info spawn args '/home/osboxes/odas_web/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/home/osboxes/odas_web/node_modules/grpc/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/home/osboxes/odas_web/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/home/osboxes/.electron-gyp/5.0.3/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/home/osboxes/.electron-gyp/5.0.3', gyp info spawn args '-Dnode_gyp_dir=/home/osboxes/odas_web/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/home/osboxes/.electron-gyp/5.0.3/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/home/osboxes/odas_web/node_modules/grpc', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/home/osboxes/odas_web/node_modules/grpc/build' CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_trace.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz_registry.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/connected_channel.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_registry.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/status_util.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_args.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_internal.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/message_compress.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_gzip.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_identity.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/format_request.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/httpcli.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/parser.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/buffer_list.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/call_combiner.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/cfstream_handle.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/combiner.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_cfstream.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_posix.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_uv.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_windows.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/error.o In file included from /usr/include/string.h:519, from /usr/include/c++/10/cstring:42, from ../deps/grpc/src/core/lib/gprpp/inlined_vector.h:25, from ../deps/grpc/src/core/lib/iomgr/error.h:33, from ../deps/grpc/src/core/lib/iomgr/error.cc:20: In function ‘void memcpy(void, const void, size_t)’, inlined from ‘void internal_set_time(grpc_error, grpc_error_times, gpr_timespec)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:267:9: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 29 | return builtin___memcpy_chk (dest, src, len, | ~~~~~^~~~~~~~ 30 | __glibc_objsize0 (__dest)); | ~~~~~~
In file included from ../deps/grpc/src/core/lib/iomgr/error.cc:36: ../deps/grpc/src/core/lib/iomgr/error_internal.h: In function ‘void internal_set_time(grpc_error
, grpc_error_times, gpr_timespec)’: ../deps/grpc/src/core/lib/iomgr/error_internal.h:58:12: note: at offset 0 to object ‘grpc_error::arena’ with size 0 declared here 58 | intptr_t arena[0]; | ^~~~~ In file included from /usr/include/string.h:519, from /usr/include/c++/10/cstring:42, from ../deps/grpc/src/core/lib/gprpp/inlined_vector.h:25, from ../deps/grpc/src/core/lib/iomgr/error.h:33, from ../deps/grpc/src/core/lib/iomgr/error.cc:20: In function ‘void
memcpy(void, const void, size_t)’, inlined from ‘void internal_add_error(grpc_error, grpc_error)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:290:9, inlined from ‘grpc_error grpc_error_create(const char*, int, const grpc_slice&, grpc_error*, size_t)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:357:23: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 29 | return builtin___memcpy_chk (dest, src, len, | ~~~~~^~~~~~~~ 30 | __glibc_objsize0 (__dest)); | ~~~~~~
In function ‘void
memcpy(void, const void, size_t)’, inlined from ‘void internal_add_error(grpc_error
, grpc_error)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:290:9, inlined from ‘grpc_error grpc_error_add_child(grpc_error, grpc_error)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:507:25: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 29 | return builtin___memcpy_chk (dest, src, len, | ~~~~~^~~~~~~~ 30 | __glibc_objsize0 (__dest)); | ~~~~~~
cc1plus: all warnings being treated as errors make: *** [grpc.target.mk:497: Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/error.o] Error 1 make: Leaving directory '/home/osboxes/odas_web/node_modules/grpc/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/osboxes/odas_web/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:314:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Linux 5.11.0-31-generic gyp ERR! command "/usr/bin/node" "/home/osboxes/odas_web/node_modules/.bin/node-gyp" "rebuild" "--target=5.0.3" "--arch=x64" "--dist-url=https://electronjs.org/headers" "--build-from-source" "--module_name=grpc_node" "--module_path=/home/osboxes/odas_web/node_modules/grpc/src/node/extension_binary/electron-v5.0-linux-x64-glibc" "--host=https://node-precompiled-binaries.grpc.io/" "--remote_path={name}/v1.21.1" "--package_name=electron-v5.0-linux-x64-glibc.tar.gz" gyp ERR! cwd /home/osboxes/odas_web/node_modules/grpc gyp ERR! node -v v12.21.0 gyp ERR! node-gyp -v v4.0.0 gyp ERR! not ok

Failed with exit code: 1

Error: gyp info it worked if it ends with ok gyp info using node-gyp@4.0.0 gyp info using node@12.21.0 | linux | x64 gyp info spawn /usr/bin/python2 gyp info spawn args [ gyp info spawn args '/home/osboxes/odas_web/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/home/osboxes/odas_web/node_modules/grpc/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/home/osboxes/odas_web/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/home/osboxes/.electron-gyp/5.0.3/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/home/osboxes/.electron-gyp/5.0.3', gyp info spawn args '-Dnode_gyp_dir=/home/osboxes/odas_web/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/home/osboxes/.electron-gyp/5.0.3/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/home/osboxes/odas_web/node_modules/grpc', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/home/osboxes/odas_web/node_modules/grpc/build' CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_trace.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz_registry.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/connected_channel.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_registry.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/status_util.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_args.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_internal.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/message_compress.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_gzip.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_identity.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/format_request.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/httpcli.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/parser.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/buffer_list.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/call_combiner.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/cfstream_handle.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/combiner.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_cfstream.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_posix.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_uv.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_windows.o CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/error.o In file included from /usr/include/string.h:519, from /usr/include/c++/10/cstring:42, from ../deps/grpc/src/core/lib/gprpp/inlined_vector.h:25, from ../deps/grpc/src/core/lib/iomgr/error.h:33, from ../deps/grpc/src/core/lib/iomgr/error.cc:20: In function ‘void memcpy(void, const void, size_t)’, inlined from ‘void internal_set_time(grpc_error, grpc_error_times, gpr_timespec)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:267:9: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 29 | return builtin___memcpy_chk (dest, src, len, | ~~~~~^~~~~~~~ 30 | __glibc_objsize0 (__dest)); | ~~~~~~
In file included from ../deps/grpc/src/core/lib/iomgr/error.cc:36: ../deps/grpc/src/core/lib/iomgr/error_internal.h: In function ‘void internal_set_time(grpc_error
, grpc_error_times, gpr_timespec)’: ../deps/grpc/src/core/lib/iomgr/error_internal.h:58:12: note: at offset 0 to object ‘grpc_error::arena’ with size 0 declared here 58 | intptr_t arena[0]; | ^~~~~ In file included from /usr/include/string.h:519, from /usr/include/c++/10/cstring:42, from ../deps/grpc/src/core/lib/gprpp/inlined_vector.h:25, from ../deps/grpc/src/core/lib/iomgr/error.h:33, from ../deps/grpc/src/core/lib/iomgr/error.cc:20: In function ‘void
memcpy(void, const void, size_t)’, inlined from ‘void internal_add_error(grpc_error, grpc_error)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:290:9, inlined from ‘grpc_error grpc_error_create(const char*, int, const grpc_slice&, grpc_error*, size_t)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:357:23: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 29 | return builtin___memcpy_chk (dest, src, len, | ~~~~~^~~~~~~~ 30 | __glibc_objsize0 (__dest)); | ~~~~~~
In function ‘void
memcpy(void, const void, size_t)’, inlined from ‘void internal_add_error(grpc_error
, grpc_error)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:290:9, inlined from ‘grpc_error grpc_error_add_child(grpc_error, grpc_error)’ at ../deps/grpc/src/core/lib/iomgr/error.cc:507:25: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 29 | return builtin___memcpy_chk (dest, src, len, | ~~~~~^~~~~~~~ 30 | __glibc_objsize0 (__dest)); | ~~~~~~
cc1plus: all warnings being treated as errors make: *** [grpc.target.mk:497: Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/error.o] Error 1 make: Leaving directory '/home/osboxes/odas_web/node_modules/grpc/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/osboxes/odas_web/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:314:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12) gyp ERR! System Linux 5.11.0-31-generic gyp ERR! command "/usr/bin/node" "/home/osboxes/odas_web/node_modules/.bin/node-gyp" "rebuild" "--target=5.0.3" "--arch=x64" "--dist-url=https://electronjs.org/headers" "--build-from-source" "--module_name=grpc_node" "--module_path=/home/osboxes/odas_web/node_modules/grpc/src/node/extension_binary/electron-v5.0-linux-x64-glibc" "--host=https://node-precompiled-binaries.grpc.io/" "--remote_path={name}/v1.21.1" "--package_name=electron-v5.0-linux-x64-glibc.tar.gz" gyp ERR! cwd /home/osboxes/odas_web/node_modules/grpc gyp ERR! node -v v12.21.0 gyp ERR! node-gyp -v v4.0.0 gyp ERR! not ok

Failed with exit code: 1 at SafeSubscriber._error (/home/osboxes/odas_web/node_modules/spawn-rx/lib/src/index.js:267:84) at SafeSubscriber.__tryOrUnsub (/home/osboxes/odas_web/node_modules/rxjs/internal/Subscriber.js:205:16) at SafeSubscriber.error (/home/osboxes/odas_web/node_modules/rxjs/internal/Subscriber.js:156:26) at Subscriber._error (/home/osboxes/odas_web/node_modules/rxjs/internal/Subscriber.js:92:26) at Subscriber.error (/home/osboxes/odas_web/node_modules/rxjs/internal/Subscriber.js:72:18) at MapSubscriber.Subscriber._error (/home/osboxes/odas_web/node_modules/rxjs/internal/Subscriber.js:92:26) at MapSubscriber.Subscriber.error (/home/osboxes/odas_web/node_modules/rxjs/internal/Subscriber.js:72:18) at SafeSubscriber._next (/home/osboxes/odas_web/node_modules/spawn-rx/lib/src/index.js:242:65) at SafeSubscriber.__tryOrUnsub (/home/osboxes/odas_web/node_modules/rxjs/internal/Subscriber.js:205:16) at SafeSubscriber.next (/home/osboxes/odas_web/node_modules/rxjs/internal/Subscriber.js:143:22) npm ERR! code 255 npm ERR! path /home/osboxes/odas_web npm ERR! command failed npm ERR! command sh -c ./node_modules/.bin/electron-rebuild

npm ERR! A complete log of this run can be found in: npm ERR! /home/osboxes/.npm/_logs/2021-08-28T21_17_31_756Z-debug.log `

t11s commented 3 years ago

Solved by changing grpc to v. 1.24.2 in package.json, this should be changed in the repository.

zholondz commented 3 years ago

It was very helpful for me. Thank you! Changed package.json" like this:

{
  "name": "odas_studio",
  "version": "0.3.0",
  "description": "A desktop GUI for the ODAS library",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "postinstall": "./node_modules/.bin/electron-rebuild"
  },
  "author": "Cedric Godin",
  "license": "MIT",
  "devDependencies": {
    "electron": "^15.3.0",
    "electron-rebuild": "^3.2.3"
  },
  "dependencies": {
    "@google-cloud/speech": "^4.9.0",
    "grpc": "^1.24.2",
    "ip": "^1.1.5",
    "mathjs": "^9.5.1",
    "node-localstorage": "^1.3.1",
    "systeminformation": "^5.9.8",
    "wav": "^1.0.2",
    "wav-file-info": "0.0.8"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/introlab/odas_web.git"
  }
}
JamesCHub commented 2 years ago

After trying many different modifications, this package.json finally worked for me - thanks!

from the odas_web directory $ npm cache clean --force $ rm -rf node_modules package-lock.json $ npm install $ npm start

Note: I could only get this to work by running locally on the pi in an lxterm - running via ssh was giving me " Unable to open X display."

Femtofirst commented 1 year ago

Hi guys, do you know if I can use node.js 14 instead of node 12? When I install node 12 it is asking me to change to node 14 because node 12 is out of date - but I kept on getting error in the electron-building process - no idea if it is caused by the wrong version of node?

Co0olCat commented 1 year ago

Looks like grpc should be replaced with "@grpc/grpc-js": "1.9.9"

Thank you.

TY