CodinGame / monaco-vscode-api

VSCode public API plugged on the monaco editor
MIT License
205 stars 29 forks source link

Installation error #420

Open Hummel009 opened 2 months ago

Hummel009 commented 2 months ago

I tried to follow the instructions in readme to install monaco-vscode-api, but there were a few errors:

Now there is still error, but I can't understand, what's wrong.

P.S. I have installed node.js, so commands like npm and gyp work well. And I should also say, that my colleagues have same problem with monaco-vscode-api installation too.

Here is screenshot of errored console.

Снимок экрана (122)

kaisalmen commented 2 months ago

Hi @Hummel009 if I am not mistaken this does not work with python 3.12.x Try python 3.11.x. I usually build this with WSL on Windows, but I can also verify this today on Windows directly.

kaisalmen commented 2 months ago

Hi @Hummel009 you have to install fitting spectre mitigation libraries. Like you I am using Visual Studio Community 2022, so in the installer you have to "Change" the installation and then go to "Individual components" and install the fitting libraries like you see in the screenshot below. @CGNonofr this is not a monaco-vscode-api issue, but could be mentioned in the README: image

CGNonofr commented 2 months ago

Sure! do you mind updating the README/troubleshooting? I'm not sure I understand fully the issue

kaisalmen commented 2 months ago

@CGNonofr will do

Hummel009 commented 1 month ago

Thanks a lot for your help! Now everything installed without any problems.

Hummel009 commented 1 month ago

There is another problem after installation. When I am using Windows and trying to launch command «npm run build», appears new error saying, that rm not exist. And when I am using WSL, it says, that package.json is not found.

err

kaisalmen commented 1 month ago

@Hummel009 building this repo from scratch is only possible on Linux and Mac. If you are using Windows consider using a WSL that's what I usually do.

CGNonofr commented 1 month ago

@Hummel009 building this repo from scratch is only possible on Linux and Mac. If you are using Windows consider using a WSL that's what I usually do.

I think they try WSL without success, I'm not familliar at all with WSL though

kaisalmen commented 1 month ago

Standard Ubuntu LTS, plus installing node.js and git should do

Hummel009 commented 1 month ago

Still couldn't configure one problem with this repo; I don't think it's now related to the installation itself, more to the configuration or dependencies... Anyway, npm run build fails due to a few errors. No edits were made to the code, the installation was successful in WSL. Снимок экрана (211) Снимок экрана (210)

CGNonofr commented 1 month ago

The Unexpected any value in conditional warnings are due to the eslint @typescript-eslint/strict-boolean-expressions plugin which is at least... bugous

I don't know about the first 2 errors.

It looks like eslint is not able to take typescript types into account...

Hummel009 commented 1 week ago

I’m still trying to install the repository, as mentioned above, only pure Ubuntu LTS 24.04 + git + node. The problem persists; The npm ci command cannot be executed, the run build command gives the errors that I attached in the screenshot above.

This month I tried several different Linux distributions, the problem was the same everywhere. At some point, I came across advice on the Internet for installing Yarn. After that, all the logs when installing the repository changed. However, this also did not lead to success.

Perhaps there are some special requirements? For example, a specific version of node or git. Also above were mentioned dependencies such as VS + spectre mitigation libraries and a special version of python, but as I understand it, this is not relevant outside WSL. Or relevant?

JonasCarlstroem commented 1 week ago

I’m still trying to install the repository, as mentioned above, only pure Ubuntu LTS 24.04 + git + node. The problem persists; The npm ci command cannot be executed, the run build command gives the errors that I attached in the screenshot above.

This month I tried several different Linux distributions, the problem was the same everywhere. At some point, I came across advice on the Internet for installing Yarn. After that, all the logs when installing the repository changed. However, this also did not lead to success.

Perhaps there are some special requirements? For example, a specific version of node or git. Also above were mentioned dependencies such as VS + spectre mitigation libraries and a special version of python, but as I understand it, this is not relevant outside WSL. Or relevant?

What version of Node and npm, where you try to build the repo, are you running? For version 5.x.x i had to use Node >= 18.x and npm >= 10.2.x

Another problem I encountered initially is that vscode encoded the "install-vscode" file with wrong line endings resulting in errors when building from Windows through wsl.

Hummel009 commented 1 week ago

I am using Node 20.15.0 and NPM 10.7.0. For the version 5.3.0 of the repo.

After installation of Ubuntu LTS 24.04 + this versions of Node and npm, I used three commands from the README of this repo. Everything was OK. Then I used npm ci, and the command ended with next error:

Installing vscode dependencies...
./scripts/install-vscode: line 36: yarn: command not found
npm error code 127
npm error path /home/hummel009/monaco
npm error command failed
npm error command sh -c patch-package && ./scripts/install-vscode

npm error A complete log of this run can be found in: /home/hummel009/.npm/_logs/2024-06-23T08_05_39_925Z-debug-0.log

I decided that I should install Yarn and I did npm install --global yarn. Then I tried npm ci again. Yarn was found, there were huge logs in terminal and they ended with next problem:

Unhandled Rejection at: Promise Promise {
  <rejected> Error: bad export type for `tree_sitter_tsx_external_scanner_create`: undefined
      at reportUndefinedSymbols (/tmp/tmp.q25qugj5OU/node_modules/web-tree-sitter/tree-sitter.js:1:19748)
      at postInstantiation (/tmp/tmp.q25qugj5OU/node_modules/web-tree-sitter/tree-sitter.js:1:17027)
      at /tmp/tmp.q25qugj5OU/node_modules/web-tree-sitter/tree-sitter.js:1:17752
      at async /tmp/tmp.q25qugj5OU/node_modules/@vscode/l10n-dev/dist/main.js:329:10
      at async /tmp/tmp.q25qugj5OU/node_modules/@vscode/l10n-dev/dist/main.js:318:22
} reason: Error: bad export type for `tree_sitter_tsx_external_scanner_create`: undefined
    at reportUndefinedSymbols (/tmp/tmp.q25qugj5OU/node_modules/web-tree-sitter/tree-sitter.js:1:19748)
    at postInstantiation (/tmp/tmp.q25qugj5OU/node_modules/web-tree-sitter/tree-sitter.js:1:17027)
    at /tmp/tmp.q25qugj5OU/node_modules/web-tree-sitter/tree-sitter.js:1:17752
    at async /tmp/tmp.q25qugj5OU/node_modules/@vscode/l10n-dev/dist/main.js:329:10
    at async /tmp/tmp.q25qugj5OU/node_modules/@vscode/l10n-dev/dist/main.js:318:22
[11:30:26] The following tasks did not complete: editor-distro
[11:30:26] Did you forget to signal async completion?
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm error code 1
npm error path /home/hummel009/monaco
npm error command failed
npm error command sh -c patch-package && ./scripts/install-vscode

npm error A complete log of this run can be found in: /home/hummel009/.npm/_logs/2024-06-23T08_19_17_756Z-debug-0.log
CGNonofr commented 1 week ago

Did you try installing Volta? we're relying on it here

kaisalmen commented 1 week ago

@CGNonofr should "yarn" be added to the volta config? I was wondering if we should add a Dockerfile with minimum set of packages, so people could use it as a devcontainer. I could propose something...

CGNonofr commented 1 week ago

@CGNonofr should "yarn" be added to the volta config? I was wondering if we should add a Dockerfile with minimum set of packages, so people could use it as a devcontainer. I could propose something...

Yarn is only used by the VSCode build script, so adding it in this project won't do much. It just guarantee yarn is present though

I'm open to anything making it easier to contribute :)

kaisalmen commented 1 week ago

It just guarantee yarn is present though

Yes, that was the intention 🙂

Hummel009 commented 1 week ago

I was able to really get a lot further with Volta, thanks for the advice! It's a pity that the repository doesn't have a step-by-step set of commands for pure Linux to get started. It's not always possible to guess.

So far the npm ci and npm run build commands have worked well, I can say. Some logs wrote errors in the process, but the resulting one said success.

But the npm start command in the demo has some errors in the process. Trying to open the editor in a browser causes the application to terminate with an error.

8b6681bf-92c0-4841-b158-47703ea452f2

CGNonofr commented 1 week ago

What are the error in the build? because not a single one is expected

Hummel009 commented 1 week ago

npm install vscode@npm:@codingame/monaco-vscode-api — deprecated warnings, vulnerabilities npm install monaco-editor@npm:@codingame/monaco-vscode-editor-api — deprecated warnings, vulnerabilities npm install -D @types/vscode — deprecated warnings, vulnerabilities npm ci — a few «peer dependency» warnings, GYP errors, kerberos errors.

The process is lengthy, this is only part of it. I'll be recording and screenshoting more, and then publish here. Снимок экрана (569) Снимок экрана (570) Снимок экрана (571) Снимок экрана (572) Снимок экрана (573) Снимок экрана (574)

CGNonofr commented 1 week ago

Ok those are in the VSCode project build process, I confirm there are a few warnings

Did you try removing the vite cache in the demo by removing node_modules/.vite? (or running npm ci)

Does the file pretended to be not existing exists on the disk?

Hummel009 commented 1 week ago

Folder .vite in node modules of demo subfolder doesn't exist, I can't remove it.

Kerberos.o really doesnt't exist, as said in the log. But kerberos folders with kerberos headers exist. Perhaps some special version of make, cmake & gcc is needed?

CGNonofr commented 1 week ago

I'm not sure, maybe the better is to refer to the VSCode build documentation directly

Hummel009 commented 1 week ago

Installing kerberos as a separate package helped get rid of this error. Now there is only one red error left, and it has something to do with git. Git is installed and I am authorized in it. Can you tell me what could be the problem?

git error

In addition, there are a large number of references to unknown files and omissions in the log. I don't know if this is fatal, or if you also have this on installation.

skip (1) skip (2)

Basically, I don't see anything else that seems serious. There are some suspicious logs, which I photographed just in case, I think I showed some of them last time, but everything else is normal.

nosus (1) nosus (2) nosus (3) nosus (4)

CGNonofr commented 1 week ago

If you wanna compare with the expected build log, you can compare with https://github.com/CodinGame/monaco-vscode-api/actions/runs/9599453082/job/26473217503 (Install dependencies section)

Hummel009 commented 1 week ago

In addition to examining the logs, I also decided to reiterate the sequence of commands that your action executes. The first difference starts here:

Your log

patching file yarn.lock
patch -p1 -i /home/runner/work/monaco-vscode-api/monaco-vscode-api/vscode-paches/0059-fix-backport-fix.patch
patching file src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
Installing vscode dependencies...
yarn config v1.22.22
success Set "ignore-engines" to true.
Done in 0.04s.
yarn install v1.22.22

My log

patching file yarn.lock
patch -p1 -i /home/hummel009/Desktop/monaco-vscode-api/vscode-paches/0059-fix-backport-fix.patch
patching file src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts
Installing vscode dependencies...
Volta error: Node is not available.

To run any Node command, first set a default version using `volta install node`
Error details written to /home/hummel009/.volta/log/volta-error-2024-06-27_15_47_36.318.log
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
npm notice To update run: npm install -g npm@10.8.1
npm notice
npm error code 126
npm error path /home/hummel009/Desktop/monaco-vscode-api
npm error command failed
npm error command sh -c patch-package && ./scripts/install-vscode

npm error A complete log of this run can be found in: /home/hummel009/.npm/_logs/2024-06-27T12_45_57_116Z-debug-0.log

Earlier this problem didn't appear because I had NPM installed before Volta. Perhaps clashing different installers is not good, but, one way or another, for some reason Volta does not work correctly for me if NPM was not installed before.

P.S. I set default version using volta install node, as log said. Nothing changed.

Hummel009 commented 1 week ago

When I pre-install NPM + Yarn and then only install Volta on the system, all the logs are exactly the same as in the online build of this repository. However, npm start in demo still does not work. It is missing 4 files (last time it was missing 7), and they are not visible in the imports. As a result, when I open the browser at a given address and port, instead of the demo just a blank screen with a title.