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

Yarn install error #1

Closed
jasonseminara opened this issue Jul 26, 2021 · 6 comments
Closed

Yarn install error #1

jasonseminara opened this issue Jul 26, 2021 · 6 comments

Comments

@jasonseminara
Copy link

Recently started receiving errors from yarn while installing. It seems to come from ssh2 -> cpu-features. The error seems to be triggered by node-gyp.

The only way it seems to get around it is to yarn install --ignore-optional, which isn't ideal.

warning Error running install script for optional dependency: "/Users/jasonseminara/projects/dev/portal/node_modules/cpu-features: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/jasonseminara/projects/dev/portal/node_modules/cpu-features
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@12.22.3 | darwin | x64
gyp info find Python using Python version 2.7.16 found at \"/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python\"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/Users/jasonseminara/projects/dev/portal/node_modules/@npmcli/run-script/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   '/Users/jasonseminara/projects/dev/portal/node_modules/cpu-features/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jasonseminara/projects/dev/portal/node_modules/@npmcli/run-script/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/jasonseminara/Library/Caches/node-gyp/12.22.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=/Users/jasonseminara/Library/Caches/node-gyp/12.22.3',
gyp info spawn args   '-Dnode_gyp_dir=/Users/jasonseminara/projects/dev/portal/node_modules/@npmcli/run-script/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/jasonseminara/Library/Caches/node-gyp/12.22.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/jasonseminara/projects/dev/portal/node_modules/cpu-features',
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' ]
  ACTION Configuring dependencies /Users/jasonseminara/projects/dev/portal/node_modules/cpu-features/deps/cpu_features/build/Makefile
/bin/sh: cmake: command not found
make: *** [/Users/jasonseminara/projects/dev/portal/node_modules/cpu-features/deps/cpu_features/build/Makefile] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/jasonseminara/projects/dev/portal/node_modules/@npmcli/run-script/node_modules/node-gyp/lib/build.js:194: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 Darwin 20.5.0
gyp ERR! command \"/usr/local/Cellar/nvm/0.38.0/versions/node/v12.22.3/bin/node\" \"/Users/jasonseminara/projects/dev/portal/node_modules/.bin/node-gyp\" \"rebuild\"
gyp ERR! cwd /Users/jasonseminara/projects/dev/portal/node_modules/cpu-features
@awprud
Copy link

awprud commented Jul 29, 2021

Same thing!

@awprud
Copy link

awprud commented Jul 29, 2021

Try installing cmake. I installed it from Ubuntu software (18.04) and it worked for me

@bogician
Copy link

bogician commented Jul 29, 2021

Same, Using M1 Mac and installing cmake doesn't help me. New error appears:
Знімок екрана 2021-07-29 о 12 48 33

@Apollon77
Copy link

cmake is a very unusual need for a nodejs module :-( it is not included in the usual build tools that are installed on user systems

gjasny added a commit to gjasny/cpu-features that referenced this issue Sep 22, 2021
@mscdex
Copy link
Owner

mscdex commented Sep 29, 2021

As mentioned in the readme for this project, cmake is required to properly build the addon. The reason cmake is required is that is the build system supported by cpu_features (the dependency) and converting the CMakeLists to gyp is not easy.

However if someone wants to give converting the CMakeLists to a gyp file, feel free to send a PR!

Regarding Apple M1, that is a different issue and is being resolved upstream here.

@mscdex mscdex closed this as completed Sep 29, 2021
@Urokhtor
Copy link

I have to bump this issue because this error also pops up when cpu-features is an optional transient dependency (for example through ssh2).

I would rather expect this situation to be logged as a warning, because seeing "harmless" errors in your logs is confusing. I don't know enough about the build environment, but would it be possible for example to check whether CMake is installed and if not, just stop there and log the situation as a warning?

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

6 participants