Theia doesn't build - tried for 3 days and I'm about to give up

I’m really confused about this flaky build system - the fact that the latest LTS versions of node, npm, yarn, … are not supported, makes it even more confusing.

This is what I followed from the README.md file:

## Quick Start

To build and run the browser example:

git clone https://github.com/eclipse-theia/theia \ && cd theia \ && yarn \ && yarn download:plugins \ && yarn browser build \ && yarn browser start

Start your browser on [http://localhost:3000](http://localhost:3000/).

Coming to the problem itself, I get a bunch of warnings while building the “example” from the README.md, it all stops at this roadblock with an error message:

[user@pc theia]$ yarn browser build
yarn run v1.7.0
$ yarn -s --cwd examples/browser build
Unknown Syntax Error: Command not found; did you mean one of:

  0. yarn cache clean [--mirror] [--all]
  1. yarn cache clean [--mirror] [--all]
  2. yarn config get [--json] [--no-redacted] <name>
  3. yarn config set [--json] [-H,--home] <name> <value>
  4. yarn config unset [-H,--home] <name>
  5. yarn set version from sources [--path #0] [--repository #0] [--branch #0] [--plugin #0] [--no-minify] [-f,--force] [--skip-plugins]
  6. yarn set version [--only-if-needed] <version>
  7. yarn workspaces list [--since] [-R,--recursive] [--no-private] [-v,--verbose] [--json]
  8. yarn --clipanion=definitions
  9. yarn help
 10. yarn help
 11. yarn help
 12. yarn <leadingArgument> ...
 13. yarn -v
 14. yarn -v
 15. yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
 16. yarn bin [-v,--verbose] [--json] [name]
 17. yarn config [-v,--verbose] [--why] [--json]
 18. yarn dedupe [-s,--strategy #0] [-c,--check] [--json] [--mode #0] ...
 19. yarn exec <commandName> ...
 20. yarn explain peer-requirements [hash]
 21. yarn explain [--json] [code]
 22. yarn info [-A,--all] [-R,--recursive] [-X,--extra #0] [--cache] [--dependents] [--manifest] [--name-only] [--virtuals] [--json] ...
 23. yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
 24. yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
 25. yarn link [-A,--all] [-p,--private] [-r,--relative] <destination>
 26. yarn unlink [-A,--all] ...
 27. yarn node ...
 28. yarn plugin import from sources [--path #0] [--repository #0] [--branch #0] [--no-minify] [-f,--force] <name>
 29. yarn plugin import <name>
 30. yarn plugin remove <name>
 31. yarn plugin list [--json]
 32. yarn plugin runtime [--json]
 33. yarn rebuild ...
 34. yarn remove [-A,--all] [--mode #0] ...
 35. yarn run
 36. yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
 37. yarn up [-i,--interactive] [-E,--exact] [-T,--tilde] [-C,--caret] [-R,--recursive] [--mode #0] ...
 38. yarn why [-R,--recursive] [--json] [--peers] <package>
 39. yarn workspace <workspaceName> <commandName> ...
 40. yarn create [-p,--package #0] [-q,--quiet] <command> ...
 41. yarn dlx [-p,--package #0] [-q,--quiet] <command> ...
 42. yarn init [-p,--private] [-w,--workspace] [-i,--install]
 43. yarn npm audit [-A,--all] [-R,--recursive] [--environment #0] [--json] [--severity #0] [--exclude #0] [--ignore #0]
 44. yarn npm info [-f,--fields #0] [--json] ...
 45. yarn npm login [-s,--scope #0] [--publish]
 46. yarn npm logout [-s,--scope #0] [--publish] [-A,--all]
 47. yarn npm publish [--access #0] [--tag #0] [--tolerate-republish] [--otp #0]
 48. yarn npm tag add <package> <tag>
 49. yarn npm tag list [--json] [package]
 50. yarn npm tag remove <package> <tag>
 51. yarn npm whoami [-s,--scope #0] [--publish]
 52. yarn pack [--install-if-needed] [-n,--dry-run] [--json] [-o,--out #0]
 53. yarn patch [--json] <package>
 54. yarn unplug [-A,--all] [-R,--recursive] [--json] ...

While running -s --cwd examples/browser build
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I’m really fascinated by the idea of Eclipse Theia and any help is highly appreciated. Thanks in advance.

Hey @bruhly-bot,

I’m really confused about this flaky build system - the fact that the latest LTS versions of node, npm, yarn, … are not supported, makes it even more confusing.

It’s not flaky for us :slight_smile: Note that we don’t have control over what node version is supported by Theia, that’s dictated by the native dependencies that we include for the electron build of Theia. VSCode has the same issues.

It’s weird that the setup doesn’t work for you. yarn@1.7.0 is quite old (5 years by now), but I’ve confirmed that our project builds as expected even with that version. We usually recommend ^1.22.0. Perhaps you can also run the commands manually (i.e. navigate to ./examples/browser and run yarn build/start).

Anyway, perhaps it makes more sense to build your own application than to just use our example/testing application. Run the theia yeoman generator for that. It will setup a project structure for a custom Theia based browser/electron application.

oh ok, using yeoman method, just saw the other similar post from 10 days ago.

still see many warnings and it stopped with this error:

hello-world: Internal Error: root-workspace-0b6124@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile

@msujew whatever I tried for the last 3 days, by reading stuff from all corners of the internet, are simply giving errors, I’m seriously starting to doubt if the problem is on my side. Well, I’m going to give it one more try with yarn@1.22.0

it’s the same error again even with yarn@^1.22.0

@msujew, I also tried to directly run those scripts from examples directory, but then just like I mentioned above, it would give an error like this:

$ yarn -s --cwd examples/browser build
Unknown Syntax Error: Command not found; did you mean one of:

@bruhly-bot I’ve never encountered such issues when building but please make sure to:

  • prerequisites [ ]
  • proxy isn’t an issue [ ]
  • not on windows, so npm is the only option, so this is a non-issue too ig [ ]

@vince-fugnitto, basically I did a quick investigation into why running something simple, like yarn build/start, is failing. Looks like these commands would run something like yarn -s compile, where yarn says that the “compile” command is not found and gives an error that looks something like this:

[user@pc theia]$ yarn browser build
yarn run v1.7.0
$ yarn -s --cwd examples/browser build
Unknown Syntax Error: Command not found; did you mean one of:

  0. yarn cache clean [--mirror] [--all]
  1. yarn cache clean [--mirror] [--all]
  2. yarn config get [--json] [--no-redacted] <name>
  3. yarn config set [--json] [-H,--home] <name> <value>
  4. yarn config unset [-H,--home] <name>
  5. yarn set version from sources [--path #0] [--repository #0] [--branch #0] [--plugin #0] [--no-minify] [-f,--force] [--skip-plugins]
  6. yarn set version [--only-if-needed] <version>
  7. yarn workspaces list [--since] [-R,--recursive] [--no-private] [-v,--verbose] [--json]
  8. yarn --clipanion=definitions
  9. yarn help
 10. yarn help
 11. yarn help
 12. yarn <leadingArgument> ...
 13. yarn -v
 14. yarn -v
 15. yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
 16. yarn bin [-v,--verbose] [--json] [name]
 17. yarn config [-v,--verbose] [--why] [--json]
 18. yarn dedupe [-s,--strategy #0] [-c,--check] [--json] [--mode #0] ...
 19. yarn exec <commandName> ...
 20. yarn explain peer-requirements [hash]
 21. yarn explain [--json] [code]
 22. yarn info [-A,--all] [-R,--recursive] [-X,--extra #0] [--cache] [--dependents] [--manifest] [--name-only] [--virtuals] [--json] ...
 23. yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
 24. yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
 25. yarn link [-A,--all] [-p,--private] [-r,--relative] <destination>
 26. yarn unlink [-A,--all] ...
 27. yarn node ...
 28. yarn plugin import from sources [--path #0] [--repository #0] [--branch #0] [--no-minify] [-f,--force] <name>
 29. yarn plugin import <name>
 30. yarn plugin remove <name>
 31. yarn plugin list [--json]
 32. yarn plugin runtime [--json]
 33. yarn rebuild ...
 34. yarn remove [-A,--all] [--mode #0] ...
 35. yarn run
 36. yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
 37. yarn up [-i,--interactive] [-E,--exact] [-T,--tilde] [-C,--caret] [-R,--recursive] [--mode #0] ...
 38. yarn why [-R,--recursive] [--json] [--peers] <package>
 39. yarn workspace <workspaceName> <commandName> ...
 40. yarn create [-p,--package #0] [-q,--quiet] <command> ...
 41. yarn dlx [-p,--package #0] [-q,--quiet] <command> ...
 42. yarn init [-p,--private] [-w,--workspace] [-i,--install]
 43. yarn npm audit [-A,--all] [-R,--recursive] [--environment #0] [--json] [--severity #0] [--exclude #0] [--ignore #0]
 44. yarn npm info [-f,--fields #0] [--json] ...
 45. yarn npm login [-s,--scope #0] [--publish]
 46. yarn npm logout [-s,--scope #0] [--publish] [-A,--all]
 47. yarn npm publish [--access #0] [--tag #0] [--tolerate-republish] [--otp #0]
 48. yarn npm tag add <package> <tag>
 49. yarn npm tag list [--json] [package]
 50. yarn npm tag remove <package> <tag>
 51. yarn npm whoami [-s,--scope #0] [--publish]
 52. yarn pack [--install-if-needed] [-n,--dry-run] [--json] [-o,--out #0]
 53. yarn patch [--json] <package>
 54. yarn unplug [-A,--all] [-R,--recursive] [--json] ...

While running -s --cwd examples/browser build
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Well I’m also going to try from windows from home pc and see how that will work out. This is by far the most difficult to set up node-js project which I have tried. But the community is really awesome, thanks for your help.

worked on windows - first attempt :slight_smile:

I think I just have to double or triple check everything for linux. :tired_face: