Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

npm install fails on FreeBSD 12.1 #1880

Closed
mike-pt opened this issue Jul 14, 2020 · 14 comments
Closed

npm install fails on FreeBSD 12.1 #1880

mike-pt opened this issue Jul 14, 2020 · 14 comments
Assignees
Labels
os-freebsd FreeBSD related waiting-for-info Waiting for more information from submitter

Comments

@mike-pt
Copy link

mike-pt commented Jul 14, 2020

  • Local OS: FreeBSD
  • Remote OS: FreeBSD
  • Remote Architecture: amd64
  • code-server --version: n/a

I can't seem to install due to missing deps its seems but I also found no clue how to install those:

npm WARN @coder/logger@1.1.11 requires a peer of @google-cloud/logging@^4.5.2 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.3.1 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.3.1 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! code-server@3.4.1 postinstall: `./postinstall.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the code-server@3.4.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-07-14T12_30_33_064Z-debug.log
``
@code-asher
Copy link
Member

Is there more to the output? I think the cause of the error might be further up. I don't think the peer dependency warnings would cause the script to fail.

@mike-pt
Copy link
Author

mike-pt commented Jul 15, 2020

Not that I could see but it was over tmux it's possible it's cutoff indeed, I was wondering if it was indeed related to dependencies missing.

I also tried yarn after and it worked but then It keeps failing with connection issues.

Im on mobile now but I'll check later if there's more output

Thanks

@nhooyr
Copy link
Contributor

nhooyr commented Jul 21, 2020

Please upload the debug log file /root/.npm/_logs/2020-07-14T12_30_33_064Z-debug.log.

@nhooyr
Copy link
Contributor

nhooyr commented Jul 21, 2020

It's likely you're just missing some dependencies. We have them listed here for Debian/Red Hat: https://github.com/cdr/code-server/blob/master/doc/npm.md

@nhooyr nhooyr added the waiting-for-info Waiting for more information from submitter label Jul 21, 2020
@mike-pt
Copy link
Author

mike-pt commented Jul 21, 2020

This is a azure VM so python3 is installed (not 2 though not sure if that matters)

but I do have:

pkg-config libsecret-devel libX11-devel libxkbfile-devel

@nhooyr
Copy link
Contributor

nhooyr commented Jul 21, 2020

Got it. Can't comment further without the full log file.

@mike-pt
Copy link
Author

mike-pt commented Jul 21, 2020

Dang it I though I uploaded it in the previous post:

2020-07-14T12_30_33_064Z-debug.log

That's the one from when I run it originally, sorry1

P.S. I also installed python2 and run: npm config set python python2 but still get the same output

@mike-pt
Copy link
Author

mike-pt commented Jul 21, 2020

I tied with yarn and it just works:

FreeBSD 12.1-RELEASE-p7
No precompiled releases available for freebsd.
Installing with yarn.

+ yarn global add code-server --unsafe-perm
yarn global v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "code-server > @coder/logger@1.1.11" has unmet peer dependency "@google-cloud/logging@^4.5.2".
[4/4] Building fresh packages...
[1/1] _ code-server
success Installed "code-server@3.4.1" with binaries:
      - code-server
Done in 206.03s.

@xpader
Copy link

xpader commented Oct 28, 2020

Same error on freebsd.

@mike-pt
Copy link
Author

mike-pt commented Nov 2, 2020

I went back to try this on a new VM and noticed trying to install the dep manually would fail:

sudo npm install -g @google-cloud/logging@^4.5.2

complains that it can't build do to a grpc issue, however latest works just fine

My best guess is this is related to grpc/grpc#15010 which was since fixed.

Maybe we just need to bump google-cloud/logging version?

@code-asher
Copy link
Member

code-asher commented Nov 3, 2020 via email

@mike-pt
Copy link
Author

mike-pt commented Nov 3, 2020

Hum but post install still failed right after that but that was the old log...

I'm actually getting different results now, It did finish install (with the warning) but on running I get:

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/lib/vscode/out/vs/server/fork.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)
    at Function.Module._load (node:internal/modules/cjs/loader:745:27)
    at Module.require (node:internal/modules/cjs/loader:972:19)
    at require (node:internal/modules/cjs/helpers:88:18)
    at t.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:17:960)
    at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
    at o (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:189)
    at Object.errorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:31:313)
    at e.triggerErrorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
    at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
    at ReadFileContext.callback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:18:342)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:273:13) {
  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/lib/vscode/out/vs/server/fork.js'
  ],
  phase: 'loading',
  moduleId: 'yazl',
  neededBy: [ 'vs/base/node/zip' ]
}
[2020-11-03T18:01:11.219Z] error VS Code exited unexpectedly with code 0

So looks like some deps are not being installed, but its at least not failing on postinstall

@mike-pt
Copy link
Author

mike-pt commented Nov 3, 2020

ah nvm I'm not even sure how it supposedly finished installing, I wipped all modules and started fresh and noticed I was missing "pkgconf"

In practice FreeBSD needs:
sudo pkg install git-lite python3 libsecret libinotify libX11 libxkbfile pkgconf

(I use git-lite but ofc one can install git, lite just has less deps, and the full package doesn't seem to be needed for this anyway)

But I missed pkgconf -.-'

I wonder if we should have this as part of the install.sh if we detect FreeBSD ?

@code-asher
Copy link
Member

code-asher commented Nov 4, 2020 via email

@nhooyr nhooyr added the os-freebsd FreeBSD related label Dec 14, 2020
@nhooyr nhooyr self-assigned this Dec 14, 2020
nhooyr added a commit that referenced this issue Dec 14, 2020
nhooyr added a commit that referenced this issue Dec 14, 2020
nhooyr added a commit that referenced this issue Dec 14, 2020
nhooyr added a commit that referenced this issue Dec 14, 2020
- Removed electron from lib/vscode but kept the types.
  - electron doesn't support FreeBSD.
- Added docs on dependencies of FreeBSD when installing via npm module.
- For now, we're going to be shipping a dynamically linked version of
  node which may cause problems but we can fix that later.

Updates #1826
Updates #1880
Updates #2320
Updates #2349
@nhooyr nhooyr closed this as completed Dec 18, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
os-freebsd FreeBSD related waiting-for-info Waiting for more information from submitter
Projects
None yet
Development

No branches or pull requests

4 participants