Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node module fails to install on Apple M1 #93

Closed
solaris007 opened this issue Oct 9, 2021 · 3 comments
Closed

Node module fails to install on Apple M1 #93

solaris007 opened this issue Oct 9, 2021 · 3 comments

Comments

@solaris007
Copy link

➜ npm install -g @openwhisk/wskdebug
/path/to/.nvm/versions/node/v14.18.0/bin/wskdebug -> /path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/wskdebug.js

> cpu-features@0.0.2 install /path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/node_modules/cpu-features
> node-gyp rebuild

  ACTION Configuring dependencies /path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/node_modules/cpu-features/deps/cpu_features/build/Makefile
-- The C compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for getauxval
-- Looking for getauxval - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/node_modules/cpu-features/deps/cpu_features/build
  TOUCH Release/obj.target/config_deps.stamp
  ACTION Building dependencies /path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/node_modules/cpu-features/deps/cpu_features/build/libcpu_features.a
[ 11%] Building C object CMakeFiles/utils.dir/src/filesystem.c.o
[ 22%] Building C object CMakeFiles/utils.dir/src/stack_line_reader.c.o
[ 33%] Building C object CMakeFiles/utils.dir/src/string_view.c.o
[ 33%] Built target utils
[ 44%] Building C object CMakeFiles/unix_based_hardware_detection.dir/src/hwcaps.c.o
[ 55%] Building C object CMakeFiles/unix_based_hardware_detection.dir/src/unix_features_aggregator.c.o
[ 55%] Built target unix_based_hardware_detection
[ 66%] Building C object CMakeFiles/cpu_features.dir/src/cpuinfo_arm.c.o
In file included from /path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/node_modules/cpu-features/deps/cpu_features/src/cpuinfo_arm.c:15:
/path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h:118:2: error: "Including cpuinfo_arm.h from a non-arm target."
#error "Including cpuinfo_arm.h from a non-arm target."
 ^
1 error generated.
make[3]: *** [CMakeFiles/cpu_features.dir/src/cpuinfo_arm.c.o] Error 1
make[2]: *** [CMakeFiles/cpu_features.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [/path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/node_modules/cpu-features/deps/cpu_features/build/libcpu_features.a] Error 2
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/path/to/.nvm/versions/node/v14.18.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/path/to/.nvm/versions/node/v14.18.0/bin/node" "/path/to/.nvm/versions/node/v14.18.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /path/to/.nvm/versions/node/v14.18.0/lib/node_modules/@openwhisk/wskdebug/node_modules/cpu-features
gyp ERR! node -v v14.18.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN @openwhisk/wskdebug@1.3.0 requires a peer of ngrok@^3.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: cpu-features@0.0.2 (node_modules/@openwhisk/wskdebug/node_modules/cpu-features):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: cpu-features@0.0.2 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
@alexkli
Copy link
Contributor

alexkli commented Nov 11, 2021

Seems to depend on upstream work: google/cpu_features#150 (see also mscdex/cpu-features#6).

Also there might be more to M1/ARM support and running openwhisk containers locally, as these containers will be x86 vs. ARM locally, but there might be some nodejs modules shared between the two.

I don't have an M1/ARM available at the moment to test any of this, so contributions are welcome :)

@alexkli
Copy link
Contributor

alexkli commented Nov 11, 2021

I noticed that you are using node 14.18, but M1 support only reached nodejs starting in v16. Maybe it already solves the issue.

I also don't see how cpu-features comes in as a dependency, I don't see it in my local master checkout. But might be that some dependency changes since last release 1.3 changed/removed it.

You could try install from master (after you switched to node 16+):

npm install apache/openwhisk-wskdebug

Let me know if that helps...

@solaris007
Copy link
Author

@alexkli i can confirm that with node LTS (16+) it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants