Open nhooyr opened 4 years ago
@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 found
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
➡ 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.
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! code-server@3.11.1 postinstall: `./postinstall.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the code-server@3.11.1 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.
- "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.
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
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.
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?
@max-hk No, I don't find any error message in browser... But I find another problem, I don't know whether it is related to the above problem or not. When I stop the code-server and do not close the page of “localhost:5941” in browser. Then when I start the code-server, It will show this message:
Try digging in the Network tab of DevTool. Do you see any failed request after opening an image?
@max-hk No, I don't find any error message in browser... But I find another problem, I don't know whether it is related to the above problem or not. When I stop the code-server and do not close the page of “localhost:5941” in browser. Then when I start the code-server, It will show this message:
I have this error message in my machine too, but everything just work.
Oh, I found the same issue in https://github.com/cdr/code-server/issues/3936. It seems like a general problem for 3.11.1 version. Maybe I should install an old version of code-server.
Oh, I found the same issue in #3936. It seems like a general problem for 3.11.1 version. Maybe I should install an old version of code-server.
Well, when I use 3.9, the image can be shown now.
If anyone runs into Cannot find module '../build/Release/pty.node'
, see the troubleshooting steps in https://github.com/cdr/code-server/issues/4115#issuecomment-914480270. We're not entirely sure what it was that fixed it, but all steps are listed.
@bpmct npm's default script-shell failed to run the postinstall script on Windows.
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! code-server@3.11.1 postinstall: `./postinstall.sh` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the code-server@3.11.1 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.- "postinstall": "./postinstall.sh" + "postinstall": "bash ./postinstall.sh"
@max-hk can you submit a pull request for this?
@bpmct Done.
I changed my username recently.
Hello at the end of the installation I get the following errors. I have run the postinstall manually and I get the same. What I can do? errors-codeserver.txt
How are you doing the installation? Do you have node
on your path?
How are you doing the installation? Do you have
node
on your path?
yes, I have node in my path I am using: npm i -g code-server if i use install by yarn I get the following error:
Hello at the end of the installation I get the following errors. I have run the postinstall manually and I get the same. What I can do? errors-codeserver.txt
I have solved it by installing with npm from Git Bash it is strange that it cannot be installed from cmd or powershell
Huh interesting! Sounds like something we will need to look into as part of this issue.
This worked for me C:\Users\"your user"\AppData\Local\Yarn\Data\global\node_modules\code-server run postinstall using gitbash run yarn install in git bash .it will work .node version switch to 14.17.0
@lavahasif when running the postinstall i keep getting mklink not found
and cannot open the terminal with error:
The terminal process failed to launch: A native exception occurred during launch (Cannot find module '../build/Release/pty.node'
Instead of installing spdlog
use this:
$ npm i -g @microsoft/1ds-core-js minimist yauzl yazl @vscode/spdlog xterm-headless
how to install code server on windows
how to install code server on windows
use npm , it just works like a charm in windows 11 on nodejs 16.20.2
yes