Closed katrinabryce closed 2 months ago
I had the same error. I somehow (not pretty!) managed to install code-server 4.18.0 it on FreeBSD (iocage jail):
pkg install git npm-node20 krb5-devel
git clone https://github.com/mongodb-js/kerberos
Modify/add the following in kerberos/binding.gyp:
'include_dirs': [
"/usr/local/include",
"<!(node -p \"require('node-addon-api').include_dir\")"
],
['OS=="mac" or OS=="linux" or OS=="freebsd"', {
Modify/add the following in kerberos/src/kerberos_common.h:
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
I did not found another way than using a local npm registry with verdaccio to install this (upper) modified kerberos npm package:
npm install -g verdaccio
Modify/add the following (fake) in kerberos/package.json:
"version": "2.0.4",
Executing verdaccio in another shell (screen):
verdaccio --listen http:0.0.0:4873
Meanwhile:
npm adduser --registry http://localhost:4873/
cd kerberos && npm publish --registry http://localhost:4873
Finally:
env FORCE_NODE_VERSION=20 npm install -g code-server --unsafe-perm
Hope there will be a better solution (like https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256144)
I tried this on a test machine with a fresh install of FreeBSD:
At the first stage, I also had to install pkgconf libinotify
Before the final stage, I had to do:
npm set registry http://localhost:4873/
npm login
Verdaccio does proxy registry.npmjs.org for anything it doesn't have installed.
To upgrade my production machine, I had to do
pkg install krb5-devel
Then I pointed npm at the registry on my test machine
npm set registry http://testbench:4873/
#Where "testbench" is the name of the computer set up in the previous step
npm login
Installed code-server
For both, I also applied the fix for terminal not working:
sed -i -e 's|switch(process.platform)|switch("linux")|' /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js
and changed the npm registry back to the default
npm set registry https://registry.npmjs.org/
If I understand correctly, this needs to be fixed upstream in the Kerberos package and is not something we can fix here, right?
Thanks to your workarounds I managed to install it. Unrelated to the issue, but as someone not terribly familiar with js and the modern web stack in general, I must voice my utmost disdain for the most vile piece of package management software there is, that is npm. If keyboards were people, mine could sue me to oblivion for numerous charges of battery and domestic violence. Thank you
Well said! :laughing:
Closing since it seems this is out of our hands.
Is there an existing issue for this?
OS/Web Information
code-server --version
: 4.18.0 (4.16.1 is the latest version that installs without errors)Steps to Reproduce
npm install -g code-server --unsafe-perm
Expected
It should install
Actual
It returns an error about being unable to find windows.h, which obviously it won't because we are in FreeBSD, not Windows.
Logs
The second log file it references doesn't exist.
Screenshot/Video
No response
Does this issue happen in VS Code or GitHub Codespaces?
Are you accessing code-server over a secure context?
Notes
This problem started in v4.17. 4.16.1 installs correctly.