question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Could not locate the bindings file.

See original GitHub issue

OS/Web Information

  • Web Browser: not concern (safari/chrome)
  • Local OS: not concern (BigSur)
  • Remote OS: FreeBSD 12.2-RELEASE r366954 GENERIC
  • Remote Architecture: UNIX
  • code-server --version: 3.10.2 387b12ef4ca404ffd39d84834e1f0776e9e3c005

Steps to Reproduce

# echo check for bindings available
dev@devel:~ % echo 'console.log(require("bindings"))' | node
[Function: bindings] {
  getFileName: [Function: getFileName],
  getRoot: [Function: getRoot]
}
# code-server

Then load code from remote url from browser

Actually anyway client side applications worked in browser.

Expected

no errors

Actual

[2021-06-24T17:59:57.059Z] info  code-server 3.10.2 387b12ef4ca404ffd39d84834e1f0776e9e3c005
[2021-06-24T17:59:57.064Z] info  Using user-data-dir ~/.local/share/code-server
[2021-06-24T17:59:57.107Z] info  Using config file ~/.config/code-server/config.yaml
[2021-06-24T17:59:57.108Z] info  HTTP server listening on http://xx.xx.xx.xx:8080 
[2021-06-24T17:59:57.108Z] info    - Authentication is disabled 
[2021-06-24T17:59:57.108Z] info    - Not serving HTTPS 
Error: Could not locate the bindings file. Tried:
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Debug/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Debug/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/Debug/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Release/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/Release/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/default/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/compiled/14.16.1/freebsd/x64/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/release/install-root/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/debug/install-root/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/default/install-root/spdlog.node
 → /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/lib/binding/node-v83-freebsd-x64/spdlog.node
    at bindings (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at t (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:101)
    at r.load (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1719)
    at r.load (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:3:10262)
    at l (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10314)
    at Object.errorback (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10435)
    at r.triggerErrorback (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:3:10626)
    at /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:3:10332
    at r.load (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1736)
    at r.load (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:3:10262)
    at l (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10314)
    at r._loadModule (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10444)
    at r._resolve (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:6:452)
    at r.defineModule (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6145)
    at r._relativeRequire (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6831)
    at n (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:5:9420)
    at v (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/server/entry.js:24:4531)
    at new Promise (<anonymous>)
    at b (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/server/entry.js:24:4511)
    at C._createSpdLogLogger (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/server/entry.js:24:5444)
    at new C (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/server/entry.js:24:5260)
    at Ae.initializeServices (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/server/entry.js:36:99964)
    at async Ae.initialize (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/server/entry.js:36:96951)
    at async process.<anonymous> (/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/server/entry.js:36:103671) {
  tries: [
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Debug/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Debug/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/Debug/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Release/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/Release/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/default/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/compiled/14.16.1/freebsd/x64/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/release/install-root/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/debug/install-root/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/default/install-root/spdlog.node',
    '/stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/lib/binding/node-v83-freebsd-x64/spdlog.node'
  ],
  phase: 'loading',
  moduleId: 'spdlog',
  neededBy: [ '===anonymous3===' ]
}

This issue can be reproduced in VS Code: No

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
oklascommented, Jun 29, 2021

I found a problem 🚀

The dependency library spdlog was somehow not built.

I go to spdlog and install (build):

# cd /stor/usr-local/share/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog
# yarn

and bindings file build/Release/spdlog.node appears

I suppose the reason was network error (or some else) that caused installation break. May be I did not notice and just run again setup. But why it does not rebuilt? - possible yarn algorithm consider spdlog as installed and does not check target files that must be built.

To be sure that it is not a problem of current code-server version I remove code-server and reinstall using curl ..| sh as in docs. And all is also worked.

So this was undefined problem during installation that caused spdlog to not build.

1reaction
jsjoeiocommented, Jun 29, 2021

It was installed with yarn (v1.22.10) so I go to folder you mentioned and yarn says command ‘rebuild’ not found (however ‘rebuild’ command is documented)

I don’t think it works with yarn but I haven’t tried. Usually when this happens during local development, npm rebuild instead lib/vscode solves the problem (it shouldn’t matter that you install globally with yarn).

Hmm…I think at this point, you should remove code-server and start from scratch. Can you try that?

  1. remove code-server
  2. install with yarn globally
  3. try running and share the logs

There is probably a dependency or two missing in your environment. These are usually the ones you need.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Could not locate the bindings file · Issue #1511 - GitHub
This happened due to an incompatible Node version, a simple solution should be to use a different node version with nvm or update...
Read more >
Error: Could not locate the bindings file. Tried: #56
In my case it was complaining about the bindings for ursa package. Fixed by simply installing it with npm install ursa . –...
Read more >
Error: Could not locate the bindings file - Edge Impulse Forum
Hello @karl404,. I just tested on Mac OS Big Sur 11.4 with a fresh installation of nodeJS v16.4.0. I have not been able...
Read more >
Error: Could not locate the bindings file. Tried - Glitch Support
Error: Could not locate the bindings file. Tried ... please help guys.! ... Hello @3MoSteve, You can try npm rebuild in your teminal...
Read more >
升级node版本后出现, Could not locate the bindings file
Error : Could not locate the bindings file. Tried: → /Users/hnzb/WebstormProjects/hnczb-crowdfunding/node_modules/bcrypt/build/bcrypt_lib.node ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found