code-server
code-server copied to clipboard
Support and publish Windows release
- [ ] Should be able to build on Windows
- [ ] See linked issues, make sure they work
- [ ] Publish Windows releases as part of CI
@nhooyr Any updates? Does 3.0 release support Windows?
There are no self contained windows releases yet.
We haven't tested but the npm package might work on windows. yarn global add code-server
There are no self contained windows releases yet.
We haven't tested but the npm package might work on windows.
yarn global add code-server
I was able to install the npm package in windows, but I encounter a few bugs,
-
src/browser/media/manifest.json
not found -
All vscode-remote-resource path returns 404 not found, but this bug can easily be solved by removing leading slash in the path agument, eg.
http://127.0.0.1:8080/vscode-remote-resource?path=/c:/Users/Max/AppData/Local/Yarn/Data/global/node_modules/@coder/code-server/lib/vscode/extensions/markdown-basics/language-configuration.json
➡ 404 not foundhttp://127.0.0.1:8080/vscode-remote-resource?path=c:/Users/Max/AppData/Local/Yarn/Data/global/node_modules/@coder/code-server/lib/vscode/extensions/markdown-basics/language-configuration.json
➡ Correct path -
Syntax highlighting, extensions and themes not working (because of 2)
-
Automatic update not working because
https://github.com/cdr/code-server/releases/download/3.2.0/code-server-3.2.0-win32-x86_64.tar.gz
does not exist
Furthermore, running the post install scripts requires Visual Studio and "VC++ 2015.3 v140 toolset for desktop (x86,x64)" to be installed, but since running code-server does not require electron to be built, I think it may be unnecessary.
@maxloh Awesome thanks for looking into it!
The package is now just code-server
on npm. We were able to get ownership from the previous owner.
src/browser/media/manifest.json not found
Fixed.
All vscode-remote-resource path returns 404 not found, but this bug can easily be solved by removing leading slash in the path agument, eg.
@code-asher
Automatic update not working because https://github.com/cdr/code-server/releases/download/3.2.0/code-server-3.2.0-win32-x86_64.tar.gz does not exist
We'll be removing automatic updates soon. See #1532 .
Furthermore, running the post install scripts requires Visual Studio and "VC++ 2015.3 v140 toolset for desktop (x86,x64)" to be installed, but since running code-server does not require electron to be built, I think it may be unnecessary.
Will mention this in docs, it is required as vscode uses native modules that have to be built.
Asher has fixed the paths, will publish a new release soon.
We're going to need to test/rewrite any shell scripts that will have to run on Windows.
Marking this for v3.4.0, couldn't test/get CI going in time for v3.3.0
How's the progress going for the windows release? :) edit: spelling
I only have a couple of minutes, and wanted to dump a couple notes here for y'all
I had trouble running code-server in development mode, because of a string smashing bug in http.ts
csStaticBase: base + "/static/" + this.options.commit + this.rootPath,
probably should becsStaticBase: path.join( base, "/static/", this.options.commit , this.rootPath),
Oddly, this didn't affect it running the npm package version in windows (when I got that hacked about and running).
(sorry for the dump, I'll try to come back and put a PR in if I get time)
Fixing that, things started working, but I ran into cases where it's failing to read the settings (which means that nothing can be changed)
Unable to read file
vscode-userdata:/c:/Users/garre/AppData/Local/code-server/Data/settings.json
(Error: Unable to resolve non-existing filevscode-userdata:/c:/Users/garre/AppData/Local/code-server/Data/settings.json
)
I went and created a file there, but it still wouldn't go. I haven't gone to look if it's just not liking the slash at the front or what.
The other problem I had was actually using a terminal window -- it'll start up powershell, but can't interact with the frame at all. Haven't looked into that either.
csStaticBase
is used for assets loaded by the browser so I think it needs to be /
. Although I think browsers will automatically convert so it shouldn't be a problem either way. But if doing that fixed something then it's very possible we're mis-using it somewhere.
I think you're right about the leading slash. I ran this on Windows:
> fs.existsSync("/c:/Users")
false
> fs.existsSync("c:/Users")
true
If you want to make the path always use forward slashes then I'd still go with
path.join( base, "/static/", this.options.commit , this.rootPath).replace(/\//g,'/')
or something that smartly puts separators in, as the string smashing was missing a slash between development
and the rest of the path. (IIRC ...static/developmentc:\...
)
Ahhh that makes sense. That's a good point.
Publishing a windows release of cloud-agent will also make it possible to use --link with Windows.
Suggested steps to improve Windows support
- [ ] fix npm/yarn's postinstall.sh to run automatically on Windows (currently opens an awkward prompt, or doesn't run at all)
- [ ] create windows builds for releases
- [ ] .msi Installer for code-server for releases
- [ ] publish Windows release for cloud-agent (details & workaround: cdr/cloud-agent#17)
Was able to install successfully without WSL, but see these errors: https://github.com/cdr/code-server/blob/ddee4f748c693c26b19af964994907c7eeef6828/lib/vscode/src/vs/platform/terminal/node/terminalProfiles.ts#L120-L134
@bpmct npm's default script-shell failed to run the postinstall script on Windows.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `./postinstall.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
It could be fixed by runing the postinstall script explicitly with bash, so that Windows will run the script with the default bash
executable.
https://github.com/cdr/code-server/blob/316c3aa999fef8d92fd39018901a9fe5c26e129e/ci/build/build-release.sh#L51
- "postinstall": "./postinstall.sh"
+ "postinstall": "bash ./postinstall.sh"
I installed code-server successfully with script-shell set to a portable git bash release (with no spaces in its path, because of this issue) and run npm i -g code-server
with powershell.
Running npm i -g code-server
in Git Bash doesn't work. Bash will fail to find the installed yarn
executable when running the postinstall script.
wao
I installed code-server successfully with script-shell set to a portable git bash release (with no spaces in its path) and run
npm i -g code-server
with powershell.Running
npm i -g code-server
in Git Bash doesn't work. Bash will fail to find the installedyarn
executable when running the postinstall script.
thank you i's just try it 🍡 hope it work
I installed code-server successfully with script-shell set to a portable git bash release (with no spaces in its path) and run
npm i -g code-server
with powershell.Running
npm i -g code-server
in Git Bash doesn't work. Bash will fail to find the installedyarn
executable when running the postinstall script.
Does this mean you had to do it with yarn or you just used Powershell instead?
Does this mean you had to do it with yarn or you just used Powershell instead?
The postinstall script setup vscode's extensions with yarn.
https://github.com/cdr/code-server/blob/911af4075f111f5c47700fbc731978bb65941a56/ci/build/npm-postinstall.sh#L89-L104
If I run npm i -g code-server
with git bash, the proccess running postinstall script will be spawned by git bash, and it doesn't recognize yarn for some reason.
However, if npm i -g code-server
was run with powershell, it setup extensions sucessfully.
It is worth mentioning that I have volta installed in my machine, which have integrations with npm global install commands.
I installed code-server successfully with script-shell set to a portable git bash release (with no spaces in its path, because of this) and run
npm i -g code-server
with powershell.Running
npm i -g code-server
in Git Bash doesn't work. Bash will fail to find the installedyarn
executable when running the postinstall script.
How you run it, @max-hk
in cmd
code-server i'm get error
internal/modules/cjs/loader.js:892 throw err; ^
@locdhthtb I do not have any problem running code-server with either cmd, powershell or git bash.
Can you post the complete error message here?
thanks @max-hk so much! i resolved it, 🍡
uninstall code-server from npm
- remove folder C/document/user..../.code-server (npm)
- installl yarn
- yarn add global code-server
- powershell > code-server
- it's working perfect
Builtin image viewer and integrated terminal won't work until I run npm rebuild
in code-server/lib/vscode/node_modules/
.
I have installed code-server successfully by yarn. But there are existing a lot of errors. I'm not sure the reasons which cause these errors.
- When I create a file or folder. The notifications will show "Running File Create participants..." for a long time.
- When I want to open the terminal by (ctrl+J), then an error will be reported as follows: """ The terminal process failed to launch: A native exception occurred during launch (Cannot find module '../build/Release/pty.node' Require stack:
- c:\Users\quyue\AppData\Local\Yarn\Data\global\node_modules\code-server\lib\vscode\node_modules\node-pty\lib\windowsPtyAgent.js
- c:\Users\quyue\AppData\Local\Yarn\Data\global\node_modules\code-server\lib\vscode\node_modules\node-pty\lib\windowsTerminal.js
- c:\Users\quyue\AppData\Local\Yarn\Data\global\node_modules\code-server\lib\vscode\node_modules\node-pty\lib\index.js
- c:\Users\quyue\AppData\Local\Yarn\Data\global\node_modules\code-server\lib\vscode\out\bootstrap-amd.js
- c:\Users\quyue\AppData\Local\Yarn\Data\global\node_modules\code-server\lib\vscode\out\bootstrap-fork.js). """
- When I open a markdown file, I could not open the preview to the side.
- My terminal for running code-server always show
Builtin image viewer and integrated terminal won't work until I run
npm rebuild
incode-server/lib/vscode/node_modules/
.
@QuYue For (2), try my fix above. In your case, the folder should be c:\Users\quyue\AppData\Local\Yarn\Data\global\node_modules\code-server\lib\vscode\node_modules\
@max-hk Wow, It works! What's more, this method can not only open terminal , but also solve (1) (3)(4). Thank you very much!
Another error, my builtin image viewer can not work, although I run npm rebuild
. It will show "An error occurred while loading the image".
And there is always an error message as follows:
@QuYue It works on my machine. Do you see any error message printed to browser's console?