Theia: Yarn theia build process fundamentally broken.

Created on 18 May 2019  路  9Comments  路  Source: eclipse-theia/theia

Description

Theia cannot install. Fresh clone into fresh environment. Install process throws gyp errors.

Reproduction Steps

(node10) balter@spectre3:~/theia$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:        18.10
Codename:       cosmic
(node10) balter@spectre3:~/theia$ which nodejs
/home/balter/conda/envs/node10/bin/nodejs
(node10) balter@spectre3:~/theia$ nodejs --version
v10.8.0
(node10) balter@spectre3:~/theia$ which npm
/home/balter/conda/envs/node10/bin/npm
(node10) balter@spectre3:~/theia$ npm --version
6.2.0
(node10) balter@spectre3:~/theia$ which yarn
/home/balter/conda/envs/node10/bin/yarn
(node10) balter@spectre3:~/theia$ yarn --version
1.16.0

Diagnostics:

(base) balter@spectre3:~$ conda create -n node10 nodejs=10.8.0 -y
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: /home/balter/conda/envs/node10

  added / updated specs:
    - nodejs=10.8.0


The following NEW packages will be INSTALLED:

  libgcc-ng          pkgs/main/linux-64::libgcc-ng-8.2.0-hdf63c60_1
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-8.2.0-hdf63c60_1
  nodejs             conda-forge/linux-64::nodejs-10.8.0-hf484d3e_1001


Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate node10
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) balter@spectre3:~$ conda activate node10
(node10) balter@spectre3:~$ which nodejs
/usr/bin/nodejs
(node10) balter@spectre3:~$ which node
/home/balter/conda/envs/node10/bin/node
(node10) balter@spectre3:~$ ln -s /home/balter/conda/envs/node10/bin/node /home/balter/conda/envs/node10/bin/nodejs
(node10) balter@spectre3:~$ which nodejs
/home/balter/conda/envs/node10/bin/nodejs
(node10) balter@spectre3:~$ nodejs --version
v10.8.0
(node10) balter@spectre3:~$ npm --version
6.2.0
(node10) balter@spectre3:~$ which npm
/home/balter/conda/envs/node10/bin/npm
(node10) balter@spectre3:~$ conda install yarn -y
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: /home/balter/conda/envs/node10

  added / updated specs:
    - yarn


The following NEW packages will be INSTALLED:

  yarn               conda-forge/linux-64::yarn-1.16.0-0


Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(node10) balter@spectre3:~$ which yarn
/home/balter/conda/envs/node10/bin/yarn
(node10) balter@spectre3:~$ yarn --version
1.16.0
(node10) balter@spectre3:~$ git clone https://github.com/theia-ide/theia.git
fatal: destination path 'theia' already exists and is not an empty directory.
(node10) balter@spectre3:~$ rm -rf theia
(node10) balter@spectre3:~$ git clone https://github.com/theia-ide/theia.git
Cloning into 'theia'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 53288 (delta 5), reused 11 (delta 0), pack-reused 53268
Receiving objects: 100% (53288/53288), 119.94 MiB | 8.42 MiB/s, done.
Resolving deltas: 100% (37065/37065), done.
Checking out files: 100% (1703/1703), done.
(node10) balter@spectre3:~$ cd theia
(node10) balter@spectre3:~/theia$ yarn
yarn install v1.16.0
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning [email protected]: The engine "vscode" appears to be invalid.
warning [email protected]: The engine "vscode" appears to be invalid.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
warning " > [email protected]" has incorrect peer dependency "typescript@>= 2.3.1 < 3".
warning "workspace-aggregator-ab104ebe-8132-47f8-85a6-4916a9ac13a9 > @theia/application-manager > [email protected]" has unmet peer dependency "font-awesome@>=4.3.0".
warning "workspace-aggregator-ab104ebe-8132-47f8-85a6-4916a9ac13a9 > @theia/debug > [email protected]" has unmet peer dependency "request@2.*.*".
warning "workspace-aggregator-ab104ebe-8132-47f8-85a6-4916a9ac13a9 > @theia/application-manager > font-awesome-webpack > [email protected]" has incorrect peer dependency "less@^2.3.1".
[5/5] Building fresh packages...
[6/14] ? @theia/node-pty
[7/14] ? drivelist
[3/14] ? electron
[4/14] ? native-keymap
error /home/balter/theia/node_modules/native-keymap: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /home/balter/theia/node_modules/native-keymap
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/home/balter/theia/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/balter/theia/node_modules/native-keymap/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/balter/theia/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/balter/.node-gyp/10.8.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=/home/balter/.node-gyp/10.8.0',
gyp info spawn args   '-Dnode_gyp_dir=/home/balter/theia/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/balter/.node-gyp/10.8.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/balter/theia/node_modules/native-keymap',
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=.' ]
Package xkbfile was not found in the pkg-config search path.
Perhaps you should add the directory containing `xkbfile.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xkbfile' found
gyp: Call to 'pkg-config x11 xkbfile --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/balter/theia/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
gyp ERR! System Linux 4.4.0-17763-Microsoft
gyp ERR! command "/home/balter/conda/envs/node10/bin/node" "/home/balter/theia/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /home/balter/theia/node_modules/native-keymap




(node10) balter@spectre3:~/theia$

Most helpful comment

I believe the following issue can be closed, the documentation has been improved to specify the prerequisite dependencies #5564 #5219.

All 9 comments

Installing the native Windows keymap fixed the problem.

https://stackoverflow.com/questions/55878536/no-package-xkbfile-found-when-build-vscode-on-ubuntu

I wonder if this has to do with the fact that VS Code is developed by Microsoft and the keymap would not naturally be found on 'nix systems (or maybe Mac OS as well).

This dependency needs to be added to the build process.

cc @spoenemann

@abalter the issue comes from native-keymap indeed, but the reason is because it has to call low level libraries via a native node extension (hence the node-gyp error you had).

On Debian-like systems, installing the required libraries allows the native extension build to succeed:

sudo apt-get install libx11-dev libxkbfile-dev

I feel like build dependencies should be documented.

@marechal-p that's it exactly. Updating the build dependencies would be great.

Personally, I seen reports of node gyp errors all over the place with node packages (npm and yarn), and have given up installing things myself because I could never get them to work. Until node package managers become as robust as other ones I use (such as apt and conda), I'll always approach node apps with a note of caution and temper my expectations.

TBF, node-gyp errors often comes from package developers rather than from the package manager...

In this case it was a lack of documentation (required libraries).

Opened https://github.com/theia-ide/theia/pull/5219.

I hear ya, but perhaps it is just a fragile system to begin with. I couldn't build Apache Zeppelin either due to node gyp errors. If Apache can't make a package that installs without a hitch, well, ...

Right now the people using node and node-based apps are mostly developer-ish folks. I'm a scientist. My primary goal is to be able to use the wonderful apps that the developer geniuses are creating, not be one of the developers. I'm happy to participate in the process such as I'm able. But, ...

Perhaps the solution is for developers to commit to supplying builds for apt, yum, conda, brew, etc. as part of the development process. That would sure help us end-users!

That would deserve its own issue :)

But I hear you as well, although one thing to remember is that this repository isn't really the home of _an_ IDE, but a framework to build IDEs. Now you can make one with little modifications just like the Theia example applications.

On the other hand, if you just want to use a web IDE, currently Gitpod offers such a product ready to use. If you want a desktop app, then you will have to build something, maybe you can start from https://github.com/theia-ide/theia-apps/tree/master/theia-electron which can output deb files.

I believe the following issue can be closed, the documentation has been improved to specify the prerequisite dependencies #5564 #5219.

Was this page helpful?
0 / 5 - 0 ratings