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

Cannot install depedencies using Yarn (problem with node-gyp) #2336

Closed
1 task done
snowc0de opened this issue Sep 10, 2020 · 1 comment
Closed
1 task done

Cannot install depedencies using Yarn (problem with node-gyp) #2336

snowc0de opened this issue Sep 10, 2020 · 1 comment

Comments

@snowc0de
Copy link

snowc0de commented Sep 10, 2020

Description

I tried to install the source code of Marktext on my computer but I couldn't run yarn install

  • Can you reproduce the issue?

Steps to reproduce

  1. Downloading the source code (commit is c77e29b)
  2. Running Yarn inside the directory using yarn install

Expected behavior:

Working without errors.

Actual behavior:

Dependencies couldn't be installed.

The log of `yarn install`
yarn install v1.22.5
$ node .electron-vue/preinstall.js
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > eslint-plugin-import@2.20.2" has incorrect peer dependency "eslint@2.x - 6.x".
warning " > eslint-plugin-vue@6.2.2" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
[4/4] Building fresh packages...
[1/14] ⠐ @hfelix/spellchecker
[2/14] ⠐ cld
[3/14] ⠐ keyboard-layout
[4/14] ⠐ ced
error /home/snowcode/marktext/node_modules/keyboard-layout: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/snowcode/marktext/node_modules/keyboard-layout
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@12.18.3 | linux | x64
gyp info find Python using Python version 2.7.18 found at "/usr/bin/python"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/opt/node/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   '/home/snowcode/marktext/node_modules/keyboard-layout/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/opt/node/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/snowcode/.cache/node-gyp/12.18.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/snowcode/.cache/node-gyp/12.18.3',
gyp info spawn args   '-Dnode_gyp_dir=/opt/node/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/snowcode/.cache/node-gyp/12.18.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/snowcode/marktext/node_modules/keyboard-layout',
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/snowcode/marktext/node_modules/keyboard-layout/build'
  CXX(target) Release/obj.target/keyboard-layout-manager/src/keyboard-layout-manager.o
In file included from ../src/keyboard-layout-manager.h:4,
                 from ../src/keyboard-layout-manager.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/keyboard-layout-manager/src/keyboard-layout-manager-linux.o
../src/keyboard-layout-manager-linux.cc:5:10: fatal error: X11/extensions/XKBrules.h: No such file or directory
    5 | #include <X11/extensions/XKBrules.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [keyboard-layout-manager.target.mk:114: Release/obj.target/keyboard-layout-manager/src/keyboard-layout-manager-linux.o] Error 1
make: Leaving directory '/home/snowcode/marktext/node_modules/keyboard-layout/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.4.0-42-generic
gyp ERR! command "/opt/node/bin/node" "/opt/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/snowcode/marktext/node_modules/keyboard-layout

Versions

  • Mark Text version: I don't know the version but the latest commit is c77e29b
  • NodeJS version: v21.18.3
  • NPM version: v6.14.6
  • Yarn version: v1.22.5
  • Operating system: Linux, see bellow for more info:
More information about the OS

image

@snowc0de snowc0de changed the title Cannot install depedencies using Yarn Cannot install depedencies using Yarn (problem with node-gyp) Sep 10, 2020
@snowc0de
Copy link
Author

Sorry, I opened this issue for nothing. I just cloned chromium before installing. I reset everything and now everything is 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

1 participant