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

Error when yarn add dockerode (cpu-features: Command failed) #656

Closed
Tzvetelin88 opened this issue Mar 7, 2022 · 4 comments
Closed

Error when yarn add dockerode (cpu-features: Command failed) #656

Tzvetelin88 opened this issue Mar 7, 2022 · 4 comments
Labels

Comments

@Tzvetelin88
Copy link

Nodejs v16

dockerode have dependency docker-modem, and docker-modem have ssh2, and ssh2 have cpu-features "0.0.2", where it is failing.

#yarn add dockerode

yarn add v1.22.17
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning " > codelyzer@6.0.2" has unmet peer dependency "@angular/compiler@>=2.3.1 <13.0.0 || ^12.0.0-next || ^12.1.0-next || ^12.2.0-next".
warning " > codelyzer@6.0.2" has unmet peer dependency "@angular/core@>=2.3.1 <13.0.0 || ^12.0.0-next || ^12.1.0-next || ^12.2.0-next".
warning " > karma-jasmine-html-reporter@1.7.0" has incorrect peer dependency "jasmine-core@>=3.8".
[4/4] 🔨 Building fresh packages...
warning Error running install script for optional dependency: "../node_modules/cpu-features: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: ../node_modules/cpu-features
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@8.2.0
gyp info using node@16.13.0 | darwin | x64
gyp info find Python using Python version 3.9.9 found at "/usr/local/opt/python@3.9/bin/python3.9"
gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args '/usr/local/lib/node_modules/npm/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 '../node_modules/cpu-features/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Library/Caches/node-gyp/16.13.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Library/Caches/node-gyp/16.13.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Library/Caches/node-gyp/16.13.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=../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 ../node_modules/cpu-features/deps/cpu_features/build/Makefile
/bin/sh: cmake: command not found
make: *** [../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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:390:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd ../node_modules/cpu-features
gyp ERR! node -v v16.13.0
gyp ERR! node-gyp -v v8.2.0
gyp ERR! not ok"
info This module is OPTIONAL, you can safely ignore this error
success Saved 1 new dependency.
info Direct dependencies
└─ dockerode@3.3.1
info All dependencies
└─ dockerode@3.3.1
✨ Done in 6.12s.

@Tzvetelin88 Tzvetelin88 changed the title Error when yarn add dockerode - Error when yarn add dockerode (cpu-features: Command failed) Mar 7, 2022
@apocas
Copy link
Owner

apocas commented Aug 19, 2022

mscdex/ssh2#1083 (comment)

Going to bump ssh2 module version.

@apocas
Copy link
Owner

apocas commented Aug 19, 2022

Fixed in v3.3.4

@apocas apocas closed this as completed Aug 19, 2022
@vlad-tura
Copy link

I had the same issue, but it was not fixed by updating to v3.3.4.
The version of docker-modem with the proper ssh2 dependency is 3.0.6, however dockerode/package.json requires ^3.0.0, which in my case didn't resolve to 3.0.6.

I fixed it by adding the following lines in my package.json (only works with npm > v8.3):

"overrides": {
    "dockerode": {
      "docker-modem": "3.0.6"
    }
}

@fedulovivan
Copy link

fedulovivan commented Jul 29, 2023

still an issue with nodejs 12.22.12 and m1 mac. yarn install gives:

warning Error running install script for optional dependency: "<truncated>node_modules/cpu-features: Command failed.
...
ValueError: invalid mode: 'rU' while trying to load binding.gyp

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

No branches or pull requests

4 participants