NPM returns "Fatal error in , line 0" on RPi 3

0

I'm attempting to install a package (all packages i've tried have the exact same result) with NPM on Raspbian, and I can't get any output other than the following.

scottbeebiwan@raspberrypi:/git/discordhook $ npm i discord.js
(node:10155) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN package.json discordhook@1.0.0 No README data


#
# Fatal error in , line 0
# Failed to create ICU date format, are ICU data files missing?
#
Illegal instruction

I'm a bit stuck here, I haven't really seen this error discussed anywhere else and I'm not sure if this is specific to ARM, Raspbian or what. I'd probably post this somewhere more fitting if I knew.

I've tried purging NPM and the Node.js packages, which did nothing.

Also tried building Node from source, but got C errors which I don't believe I need to attempt to troubleshoot:

scottbeebiwan@raspberrypi:~/node $ ./configure && make
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'armv7': 0,
                 'clang': 0,
                 'gcc_version': 63,
                 'host_arch': 'arm',
                 'node_install_npm': 'true',
                 'node_install_waf': 'true',
                 'node_prefix': '',
                 'node_shared_openssl': 'false',
                 'node_shared_v8': 'false',
                 'node_shared_zlib': 'false',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_openssl': 'true',
                 'target_arch': 'arm',
                 'v8_no_strict_aliasing': 1,
                 'v8_use_arm_eabi_hardfloat': 'true',
                 'v8_use_snapshot': 'true'}}
creating  ./config.gypi
creating  ./config.mk
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory '/home/pi/node/out'
  g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DENABLE_DEBUGGER_SUPPORT' '-DV8_TARGET_ARCH_ARM' '-DUSE_EABI_HARDFLOAT=1' '-DCAN_USE_VFP2_INSTRUCTIONS' -I../deps/v8/src  -Wall -pthread -fno-strict-aliasing -mfloat-abi=hard -O2 -fno-strict-aliasing -fno-tree-vrp -fomit-frame-pointer -fno-rtti -fno-exceptions -MMD -MF /home/pi/node/out/Release/.deps//home/pi/node/out/Release/obj.target/v8_base/deps/v8/src/accessors.o.d.raw  -c -o /home/pi/node/out/Release/obj.target/v8_base/deps/v8/src/accessors.o ../deps/v8/src/accessors.cc
In file included from ../deps/v8/src/v8globals.h:32:0,
                 from ../deps/v8/src/v8.h:53,
                 from ../deps/v8/src/accessors.cc:28:
../deps/v8/src/v8utils.h: In function ‘void v8::internal::CopyWords(T*, T*, int)’:
../deps/v8/src/checks.h:251:22: warning: typedef ‘__StaticAssertTypedef__125’ locally defined but not used [-Wunused-local-typedefs]
     SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
                      ^
../deps/v8/src/checks.h:241:39: note: in definition of macro ‘SEMI_STATIC_JOIN_HELPER’
 #define SEMI_STATIC_JOIN_HELPER(a, b) a##b
                                       ^
../deps/v8/src/checks.h:251:5: note: in expansion of macro ‘SEMI_STATIC_JOIN’
     SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
     ^~~~~~~~~~~~~~~~
../deps/v8/src/checks.h:283:30: note: in expansion of macro ‘STATIC_CHECK’
 #define STATIC_ASSERT(test)  STATIC_CHECK(test)
                              ^~~~~~~~~~~~
../deps/v8/src/v8utils.h:125:3: note: in expansion of macro ‘STATIC_ASSERT’
   STATIC_ASSERT(sizeof(T) == kPointerSize);
   ^~~~~~~~~~~~~
In file included from ../deps/v8/src/elements.h:32:0,
                 from ../deps/v8/src/objects-inl.h:38,
                 from ../deps/v8/src/v8.h:60,
                 from ../deps/v8/src/accessors.cc:28:
../deps/v8/src/objects.h: At global scope:
../deps/v8/src/objects.h:5017:44: error: left operand of shift expression ‘(-1 << 3)’ is negative [-fpermissive]
   static const int kElementsKindMask = (-1 << kElementsKindShift) &
                                        ~~~~^~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/objects.h:7152:36: error: left operand of shift expression ‘(-8 << 26)’ is negative [-fpermissive]
       (~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) |
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
deps/v8/tools/gyp/v8_base.target.mk:215: recipe for target '/home/pi/node/out/Release/obj.target/v8_base/deps/v8/src/accessors.o' failed
make[1]: *** [/home/pi/node/out/Release/obj.target/v8_base/deps/v8/src/accessors.o] Error 1
make[1]: Leaving directory '/home/pi/node/out'
Makefile:26: recipe for target 'node' failed
make: *** [node] Error 2

Is there a way to fix this? I'd prefer not to re-install Raspbian if that's a solution, as my website and Git repositories are hosted on this and it'd be a pain to backup and start anew.

ScottBeebiWan

Posted 2019-05-24T06:46:32.557

Reputation: 1

No answers