coder / code-server

VS Code in the browser
https://coder.com
MIT License
68.22k stars 5.6k forks source link

[Bug]: Missing dependencies (minimist, yauzl, yazl) #5530

Open U5B opened 2 years ago

U5B commented 2 years ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

  1. Install code-server by doing npm --global i code-server --unsafe-perm
  2. Startup code-server with no errors
  3. Send request to server, server gives error

Expected

No errors: webpage should display

Actual

Errors appear

Logs

Loading "minimist" failed
Error: Cannot find module 'minimist'
Require stack:
- /usr/local/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js
- /usr/local/lib/node_modules/code-server/out/node/util.js
- /usr/local/lib/node_modules/code-server/out/node/cli.js
- /usr/local/lib/node_modules/code-server/out/node/entry.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Function.require._load (/usr/local/lib/node_modules/code-server/out/node/plugin.js:54:74)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at r (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:101)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1720)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at Object.errorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10423)
    at e.triggerErrorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11369)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11075
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1737)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at o._loadModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10432)
    at o._resolve (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:452)
    at o.defineModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144)
    at y (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1825)
    at h (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2554)
    at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/server/node/server.main.js:75:26132)
    at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/server/node/server.main.js:176:2108)
    at e._createAndEvalScript (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2598)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2237
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js',
    '/usr/local/lib/node_modules/code-server/out/node/util.js',
    '/usr/local/lib/node_modules/code-server/out/node/cli.js',
    '/usr/local/lib/node_modules/code-server/out/node/entry.js'
  ],
  phase: 'loading',
  moduleId: 'minimist',
  neededBy: [ 'vs/platform/environment/node/argv' ]
}
Here are the modules that depend on it:
[ 'vs/platform/environment/node/argv' ]
Loading "@microsoft/1ds-core-js" failed
Error: Cannot find module '@microsoft/1ds-core-js'
Require stack:
- /usr/local/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js
- /usr/local/lib/node_modules/code-server/out/node/util.js
- /usr/local/lib/node_modules/code-server/out/node/cli.js
- /usr/local/lib/node_modules/code-server/out/node/entry.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Function.require._load (/usr/local/lib/node_modules/code-server/out/node/plugin.js:54:74)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at r (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:101)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1720)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at Object.errorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10423)
    at e.triggerErrorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11369)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11075
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1737)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at o._loadModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10432)
    at o._resolve (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:452)
    at o.defineModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144)
    at y (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1825)
    at h (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2554)
    at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/server/node/server.main.js:135:9424)
    at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/server/node/server.main.js:176:2108)
    at e._createAndEvalScript (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2598)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2237
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js',
    '/usr/local/lib/node_modules/code-server/out/node/util.js',
    '/usr/local/lib/node_modules/code-server/out/node/cli.js',
    '/usr/local/lib/node_modules/code-server/out/node/entry.js'
  ],
  phase: 'loading',
  moduleId: '@microsoft/1ds-core-js',
  neededBy: [ 'vs/server/node/telemetryClient' ]
}
Here are the modules that depend on it:
[ 'vs/server/node/telemetryClient' ]
Loading "yauzl" failed
Error: Cannot find module 'yauzl'
Require stack:
- /usr/local/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js
- /usr/local/lib/node_modules/code-server/out/node/util.js
- /usr/local/lib/node_modules/code-server/out/node/cli.js
- /usr/local/lib/node_modules/code-server/out/node/entry.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Function.require._load (/usr/local/lib/node_modules/code-server/out/node/plugin.js:54:74)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at r (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:101)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1720)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at Object.errorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10423)
    at e.triggerErrorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11369)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11075
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1737)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at o._loadModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10432)
    at o._resolve (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:452)
    at o.defineModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144)
    at y (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1825)
    at h (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2554)
    at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/server/node/server.main.js:140:86230)
    at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/server/node/server.main.js:176:2108)
    at e._createAndEvalScript (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2598)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2237
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js',
    '/usr/local/lib/node_modules/code-server/out/node/util.js',
    '/usr/local/lib/node_modules/code-server/out/node/cli.js',
    '/usr/local/lib/node_modules/code-server/out/node/entry.js'
  ],
  phase: 'loading',
  moduleId: 'yauzl',
  neededBy: [ 'vs/base/node/zip' ]
}
Here are the modules that depend on it:
[ 'vs/base/node/zip' ]
Loading "yazl" failed
Error: Cannot find module 'yazl'
Require stack:
- /usr/local/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js
- /usr/local/lib/node_modules/code-server/out/node/util.js
- /usr/local/lib/node_modules/code-server/out/node/cli.js
- /usr/local/lib/node_modules/code-server/out/node/entry.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Function.require._load (/usr/local/lib/node_modules/code-server/out/node/plugin.js:54:74)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at r (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:101)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1720)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at Object.errorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10423)
    at e.triggerErrorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11369)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11075
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1737)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005)
    at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302)
    at o._loadModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10432)
    at o._resolve (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:452)
    at o.defineModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144)
    at y (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1825)
    at h (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2554)
    at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/server/node/server.main.js:140:86230)
    at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/server/node/server.main.js:176:2108)
    at e._createAndEvalScript (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2598)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2237
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/code-server/lib/vscode/out/bootstrap-amd.js',
    '/usr/local/lib/node_modules/code-server/out/node/util.js',
    '/usr/local/lib/node_modules/code-server/out/node/cli.js',
    '/usr/local/lib/node_modules/code-server/out/node/entry.js'
  ],
  phase: 'loading',
  moduleId: 'yazl',
  neededBy: [ 'vs/base/node/zip' ]
}

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

Are you accessing code-server over HTTPS?

Notes

There are other errors when not installing globally (such as a 404 error).

U5B commented 2 years ago

Logs of code-server installation without --global https://hastebin.com/mojarihica.sql

completely unrelated

U5B commented 2 years ago

Installing with yarn with code-server v4.6.1 gives the same error as the npm install. However, installing with yarn for code-server v4.6.0 has no error.

(side note, npm for v4.6.0 and below don't work on my system due to node-gyp issues)

ravi0the0sun commented 2 years ago

Same error after installing code-server on my raspberry pi using npm

jsjoeio commented 2 years ago

So it's not installing some dependencies 🤔 @edvincent any insight here since you're the npm expert?

I wonder if it's because of node-gyp issues or some native dependencies or something.

edvincent commented 2 years ago

@edvincent any insight here since you're the npm expert?

🤓😬😂

Are all of the installs using ARM & Windows? I don't have my RPi handy until this evening so I can't test myself...

But I saw similar errors in the past when some of the nested install commands would fail - and unfortunately the logging sometimes get swallowed.

Anyone can try to run npm install from inside the lib/vscode and lib/vscode/extensions folder where code-server got installed?

edvincent commented 2 years ago

Ok able to reproduce on Ubuntu 22.04 on an ARM instance. Seems a problem with the underlying dependencies of lib/vscode, specifically xterm... Which I would have expected the shrinkwrap file to prevent...

ubuntu@ip-172-31-53-135:~/.nvm/versions/node/v16.17.0/lib/node_modules/code-server/lib/vscode$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: xterm-addon-search@0.10.0-beta.3
npm ERR! Found: xterm@4.20.0-beta.20
npm ERR! node_modules/xterm
npm ERR!   xterm@"4.20.0-beta.20" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer xterm@"^4.0.0" from xterm-addon-search@0.10.0-beta.3
npm ERR! node_modules/xterm-addon-search
npm ERR!   xterm-addon-search@"0.10.0-beta.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: xterm@4.19.0
npm ERR! node_modules/xterm
npm ERR!   peer xterm@"^4.0.0" from xterm-addon-search@0.10.0-beta.3
npm ERR!   node_modules/xterm-addon-search
npm ERR!     xterm-addon-search@"0.10.0-beta.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/ubuntu/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2022-09-02T17_25_45_732Z-debug-0.log
edvincent commented 2 years ago

A short term hack/workaround: after the global install, go to the node_modules/code-server/lib/vscode directory directly and issue an npm install --legacy-peer-deps.

edvincent commented 2 years ago

I suspect it's an issue with how the combo npm + semver computes peerDependencies...

Likely the semver carret plays differently with beta versions - i.e. doesn't really consider 4.20.0-betaXX as a valid version above 4.19.0?

edvincent commented 2 years ago
> semver.satisfies('4.20.0', '^4.19.0')
true
> semver.satisfies('4.20.0-beta.20', '^4.19.0')
false
> semver.satisfies('4.20.0-beta.20', '^4.19.0', {includePrerelease: true})
true

And the explanation is the same that from https://github.com/coder/code-server/pull/4918 and comes in https://github.com/npm/node-semver#prerelease-tags: pre-release tags are in a different "namespace".

Not sure why yarn (when we install everything during development) is not complaining about this...

edvincent commented 2 years ago

I guess https://github.com/yarnpkg/yarn/pull/3361 would explain that...

edvincent commented 2 years ago

Relevant discussion for npm: https://github.com/npm/rfcs/pull/397, but doesn't seem to go anywhere...

Brainstorming on next steps/fixes - happy to hear thoughts/other ideas:

And either way, need to sanity check why logging for the nested commands is not being bubbled up to the user...

jsjoeio commented 2 years ago

Edit the install script to issue a --legacy-peer-deps, which is going to revert to an older behavior which won't validate these peer-deps.

I think we're going to try this for now to unblock installing via npm. see: https://github.com/coder/code-server/pull/5533

Once CI passes, we'll publish 4.6.1-1 on npm manually to unblock people and allow us to publish to homebrew: https://github.com/Homebrew/homebrew-core/pull/109430

Not sure which of those solutions are best. cc @code-asher

side note: @edvincent your investigation/notes are super thorough and you found all this super fast!!! Thank you!

ravi0the0sun commented 2 years ago
sudo yarn global code-server
yarn global v1.22.19
warning package.json: No license field
error Invalid subcommand. Try "add, bin, dir, ls, list, remove, upgrade, upgrade-interactive"
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
ravi@pi:~ $ sudo yarn global add code-server
yarn global v1.22.19
warning package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "code-server > @coder/logger@1.1.16" has unmet peer dependency "@google-cloud/logging@^4.5.2".
[4/4] Building fresh packages...
[2/2] ⠂ code-server
error /usr/local/share/.config/yarn/global/node_modules/code-server: Command failed.
Exit code: 1
Command: sh ./postinstall.sh
Arguments: 
Directory: /usr/local/share/.config/yarn/global/node_modules/code-server
Output:
Installing Code dependencies...
yarn.lock file not present, not running in development mode. use npm to install code-server!

Unfortunately I get error while installing code-server using yarn and it asks me to use npm to install it but when doing that I get

sudo npm install -g code-server
npm ERR! code 1
npm ERR! path /usr/lib/node_modules/code-server
npm ERR! command failed
npm ERR! command sh /tmp/postinstall-7802dc33.sh
npm ERR! Please pass --unsafe-perm to npm to install code-server
npm ERR! Otherwise the postinstall script does not have permissions to run
npm ERR! See https://docs.npmjs.com/misc/config#unsafe-perm
npm ERR! See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-09-03T02_25_12_938Z-debug-0.log

seems to be an error with the postinstall.sh script i can use the --unsafe-perm flag to install it properly but it ends up giving me the error of missing dependencies.

mobinmohammadi10 commented 2 years ago

I tried installing this three packages with npm globally and it seems the problem is solved sudo npm install -g @microsoft/1ds-core-js minimist yauzl i hope this will solve the problem

realthk commented 1 year ago

I tried installing this three packages with npm globally and it seems the problem is solved sudo npm install -g @microsoft/1ds-core-js minimist yauzl i hope this will solve the problem

Yes, thanks! On FreeBSD also had to add vscode-proxy-agent @vscode/ripgrep vscode-regexpp xterm-headless spdlog @parcel/watcher the same way because of some warnings, and still have [IPC Library: Pty Host] Error: Platform not supported error, so no terminal available, but the editor works fine, that's the point.

mrexodia commented 1 year ago

I got an error installing spdlog:

C:\Users\Admin>npm i -g spdlog
npm ERR! code 1
npm ERR! path C:\Users\Admin\AppData\Roaming\npm\node_modules\spdlog
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR!   main.cc
npm ERR! C:\Users\Admin\AppData\Local\node-gyp\Cache\16.17.0\include\node\node.h(73,10): fatal  error C1083: Cannot open include file: 'v8.h': No such file or directory [C:\Users\Admin\AppData\Roaming\npm\node_modules\spdlog\build\spdlog.vcxproj]

It was resolved by deleting %LocalAppData%/node-gyp/Cache (https://github.com/nodejs/node-gyp/issues/2482#issuecomment-1004696012)

Initial-heart-1 commented 1 year ago

Exactly the same problem was found on Windows Server 2022. code-server@4.10.0 After deployment was complete, I found 4.10.1, which had just been updated, but when I reviewing CHANGELOG I did not find anything related to it. Env. TencentCloud CVM Windows Server 2022 Datacenter X64 Simplified Chinese

Initial-heart-1 commented 1 year ago

I tried to run:

npm install --global @microsoft/1ds-core-js minimist yauzl

and restart device, but it doesn't working.

hweeks commented 1 year ago

@Initial-heart-1 you missed quite a few packages try:

npm i -g @microsoft/1ds-core-js minimist yauzl yazl spdlog

I think this is coming from y'alls lack of understanding of the new yarn and some things. right now if you're on a corepack enabled node version, anything past 16.17.0, and use a non yarn 1.22.19 install it all blows up. if this is your current hell hole here's how you can make this package run as if yarn 1 is the only yarn that exists:

export const installCodeServer = () => {
  spawnSync('corepack', ['yarn@1.22.19', 'global', 'add', 'code-server@4.11.0'])
  // without these globals it doesn't work
  spawnSync('corepack', ['yarn@1.22.19', 'global', 'add', '@microsoft/1ds-core-js', 'minimist', 'yauzl', 'yazl', 'spdlog'])
  process.stdout.write('code-server version 4.11.0 installed\n')
}
beaclnd commented 1 year ago

After installing code-server(v4.11.0) on my Raspberry Pi 3(OS: Raspbian GNU/Linux 11) with npm(node v16.16.0): npm i -g code-server --unsafe-perm, i installed the missing libraries with the following commands:

npm i -g @microsoft/1ds-core-js minimist yauzl yazl spdlog xterm-headless
sudo apt install libsecret-1-dev

then changed into the node_modules/code-server/lib/vscode directory to run the command:

npm i --legacy-peer-deps

Eventually code-server works as expected.

fishbar commented 1 year ago

v4.12.0 still have this problem, it need to install vscode's node_modules manually:

cd path_to_global_node_modules/codeserver/lib/vscode && npm i . --production --force

after installed, code-server can start up successfully.

seams the npm post install script should add this step

Initial-heart-1 commented 1 year ago

Oh, not so good...I seem to have been successful in the solution to this problem, because it has indeed worked well on my server for a while, but I seem to forget what I did... Anyway, I'm running code-server@4.10.0 on my server (Windows 10 Pro).

kwekewk commented 1 year ago

info? it still persist on latest version

TimothyBruce commented 1 year ago

Issue persists September 10, 2023. Any updates?

danchitnis commented 11 months ago

Please use docker and code-server-python. It is tested on RPI4 Pi OS 64-bit. For 32-bit, you have to build the image manually. You can modify the base image to work with other frameworks.

code-asher commented 3 months ago

Does this still persist in the latest version? I am not sure there are any errors on our end, we already install modules as part of the postinstall: https://github.com/coder/code-server/blob/6a140706642578ea8bd290254457f25d77499956/ci/build/npm-postinstall.sh#L145-L147