v1.12.0 error: uncaughtException: Could not locate the bindings file.
-
Hi, I'm using NodeBB v1.12.0 on Debian 9, I use an Nginx reverse proxy that also does SSL. I'm having problems uploading .jpg pictures to threads. The .jpg I'm trying to upload is
880.4 kB
in size, it's dimensions are1536x1152
pixels.Below are the errors produced when I try to upload a .jpg, I've replaced my real domain name with
mydomain.com
2019-03-18T03:51:21.602Z [4567/1193] - error: uncaughtException: Could not locate the bindings file. Tried: → /home/nodebb/NodeBB/node_modules/sharp/build/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/compiled/11.12.0/linux/x64/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v67-linux-x64/sharp.node Error: Could not locate the bindings file. Tried: → /home/nodebb/NodeBB/node_modules/sharp/build/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/compiled/11.12.0/linux/x64/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v67-linux-x64/sharp.node at bindings (/home/nodebb/NodeBB/node_modules/bindings/bindings.js:124:9) at Object.<anonymous> (/home/nodebb/NodeBB/node_modules/sharp/lib/constructor.js:10:34) at Module._compile (internal/modules/cjs/loader.js:799:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10) at Module.load (internal/modules/cjs/loader.js:666:32) at tryModuleLoad (internal/modules/cjs/loader.js:606:12) at Function.Module._load (internal/modules/cjs/loader.js:598:3) at Module.require (internal/modules/cjs/loader.js:705:19) at require (internal/modules/cjs/helpers.js:14:16) at Object.<anonymous> (/home/nodebb/NodeBB/node_modules/sharp/lib/index.js:3:15) {"error":{"tries":["/home/nodebb/NodeBB/node_modules/sharp/build/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/compiled/11.12.0/linux/x64/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v67-linux-x64/sharp.node"]},"stack":"Error: Could not locate the bindings file. Tried:\n → /home/nodebb/NodeBB/node_modules/sharp/build/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/compiled/11.12.0/linux/x64/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v67-linux-x64/sharp.node\n at bindings (/home/nodebb/NodeBB/node_modules/bindings/bindings.js:124:9)\n at Object.<anonymous> (/home/nodebb/NodeBB/node_modules/sharp/lib/constructor.js:10:34)\n at Module._compile (internal/modules/cjs/loader.js:799:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)\n at Module.load (internal/modules/cjs/loader.js:666:32)\n at tryModuleLoad (internal/modules/cjs/loader.js:606:12)\n at Function.Module._load (internal/modules/cjs/loader.js:598:3)\n at Module.require (internal/modules/cjs/loader.js:705:19)\n at require (internal/modules/cjs/helpers.js:14:16)\n at Object.<anonymous> (/home/nodebb/NodeBB/node_modules/sharp/lib/index.js:3:15)","exception":true,"date":"Mon Mar 18 2019 03:51:21 GMT+0000 (Coordinated Universal Time)","process":{"pid":1193,"uid":1001,"gid":1001,"cwd":"/home/nodebb/NodeBB","execPath":"/usr/bin/node","version":"v11.12.0","argv":["/usr/bin/node","/home/nodebb/NodeBB/app.js"],"memoryUsage":{"rss":118304768,"heapTotal":82726912,"heapUsed":73430176,"external":36187401}},"os":{"loadavg":[0.16015625,0.0537109375,0.064453125],"uptime":1297},"trace":[{"column":9,"file":"/home/nodebb/NodeBB/node_modules/bindings/bindings.js","function":"bindings","line":124,"method":null,"native":false},{"column":34,"file":"/home/nodebb/NodeBB/node_modules/sharp/lib/constructor.js","function":null,"line":10,"method":null,"native":false},{"column":30,"file":"internal/modules/cjs/loader.js","function":"Module._compile","line":799,"method":"_compile","native":false},{"column":10,"file":"internal/modules/cjs/loader.js","function":"Module._extensions..js","line":810,"method":".js","native":false},{"column":32,"file":"internal/modules/cjs/loader.js","function":"Module.load","line":666,"method":"load","native":false},{"column":12,"file":"internal/modules/cjs/loader.js","function":"tryModuleLoad","line":606,"method":null,"native":false},{"column":3,"file":"internal/modules/cjs/loader.js","function":"Module._load","line":598,"method":"_load","native":false},{"column":19,"file":"internal/modules/cjs/loader.js","function":"Module.require","line":705,"method":"require","native":false},{"column":16,"file":"internal/modules/cjs/helpers.js","function":"require","line":14,"method":null,"native":false},{"column":15,"file":"/home/nodebb/NodeBB/node_modules/sharp/lib/index.js","function":null,"line":3,"method":null,"native":false}]} 2019-03-18T03:51:21.602Z [4567/1193] - error: Could not locate the bindings file. Tried: → /home/nodebb/NodeBB/node_modules/sharp/build/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/compiled/11.12.0/linux/x64/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v67-linux-x64/sharp.node {"tries":["/home/nodebb/NodeBB/node_modules/sharp/build/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/compiled/11.12.0/linux/x64/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v67-linux-x64/sharp.node"]} 2019-03-18T03:51:21.603Z [4567/1193] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised. 2019-03-18T03:51:21.606Z [4567/1193] - info: [app] Web server closed to connections. 2019-03-18T03:51:21.606Z [4567/1193] - info: [app] Live analytics saved. 2019-03-18T03:51:21.607Z [4567/1193] - info: [app] Database connection closed. 2019-03-18T03:51:21.607Z [4567/1193] - info: [app] Shutdown complete. [cluster] Child Process (1193) has exited (code: 1, signal: null) [cluster] Spinning up another process... 2019-03-18T03:51:21.873Z [4567/1229] - info: Initializing NodeBB v1.12.0 http://forums.mydomain.com [benchpressjs] Unable to build or find a suitable native module, falling back to JS version 2019-03-18T03:51:23.267Z [4567/1229] - info: [socket.io] Restricting access to origin: http://forums.mydomain.com:* 2019-03-18T03:51:23.490Z [4567/1229] - info: Routes added 2019-03-18T03:51:23.492Z [4567/1229] - info: NodeBB Ready 2019-03-18T03:51:23.497Z [4567/1229] - info: Enabling 'trust proxy' 2019-03-18T03:51:23.500Z [4567/1229] - info: NodeBB is now listening on: 0.0.0.0:4567
-
What node version are you on? Try Node 10 if you haven't already.
-
@wayne-workman yes, please try downgrading
-
@PitaJ So this is strange. I downgraded the forums to
v10.15.3
and still I'm getting errors when uploading photos.2019-03-23T20:37:11.013Z [4567/610] - error: uncaughtException: Could not locate the bindings file. Tried: → /home/nodebb/NodeBB/node_modules/sharp/build/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/compiled/10.15.3/linux/x64/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v64-linux-x64/sharp.node Error: Could not locate the bindings file. Tried: → /home/nodebb/NodeBB/node_modules/sharp/build/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/compiled/10.15.3/linux/x64/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v64-linux-x64/sharp.node at bindings (/home/nodebb/NodeBB/node_modules/bindings/bindings.js:124:9) at Object.<anonymous> (/home/nodebb/NodeBB/node_modules/sharp/lib/constructor.js:10:34) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (/home/nodebb/NodeBB/node_modules/sharp/lib/index.js:3:15) {"error":{"tries":["/home/nodebb/NodeBB/node_modules/sharp/build/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/compiled/10.15.3/linux/x64/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v64-linux-x64/sharp.node"]},"stack":"Error: Could not locate the bindings file. Tried:\n → /home/nodebb/NodeBB/node_modules/sharp/build/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/compiled/10.15.3/linux/x64/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node\n → /home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v64-linux-x64/sharp.node\n at bindings (/home/nodebb/NodeBB/node_modules/bindings/bindings.js:124:9)\n at Object.<anonymous> (/home/nodebb/NodeBB/node_modules/sharp/lib/constructor.js:10:34)\n at Module._compile (internal/modules/cjs/loader.js:701:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)\n at Module.load (internal/modules/cjs/loader.js:600:32)\n at tryModuleLoad (internal/modules/cjs/loader.js:539:12)\n at Function.Module._load (internal/modules/cjs/loader.js:531:3)\n at Module.require (internal/modules/cjs/loader.js:637:17)\n at require (internal/modules/cjs/helpers.js:22:18)\n at Object.<anonymous> (/home/nodebb/NodeBB/node_modules/sharp/lib/index.js:3:15)","exception":true,"date":"Sat Mar 23 2019 20:37:11 GMT+0000 (Coordinated Universal Time)","process":{"pid":610,"uid":1001,"gid":1001,"cwd":"/home/nodebb/NodeBB","execPath":"/usr/local/bin/node","version":"v10.15.3","argv":["/usr/local/bin/node","/home/nodebb/NodeBB/app.js"],"memoryUsage":{"rss":161124352,"heapTotal":125444096,"heapUsed":99242192,"external":37354140}},"os":{"loadavg":[0.42431640625,0.14453125,0.05078125],"uptime":68},"trace":[{"column":9,"file":"/home/nodebb/NodeBB/node_modules/bindings/bindings.js","function":"bindings","line":124,"method":null,"native":false},{"column":34,"file":"/home/nodebb/NodeBB/node_modules/sharp/lib/constructor.js","function":null,"line":10,"method":null,"native":false},{"column":30,"file":"internal/modules/cjs/loader.js","function":"Module._compile","line":701,"method":"_compile","native":false},{"column":10,"file":"internal/modules/cjs/loader.js","function":"Module._extensions..js","line":712,"method":".js","native":false},{"column":32,"file":"internal/modules/cjs/loader.js","function":"Module.load","line":600,"method":"load","native":false},{"column":12,"file":"internal/modules/cjs/loader.js","function":"tryModuleLoad","line":539,"method":null,"native":false},{"column":3,"file":"internal/modules/cjs/loader.js","function":"Module._load","line":531,"method":"_load","native":false},{"column":17,"file":"internal/modules/cjs/loader.js","function":"Module.require","line":637,"method":"require","native":false},{"column":18,"file":"internal/modules/cjs/helpers.js","function":"require","line":22,"method":null,"native":false},{"column":15,"file":"/home/nodebb/NodeBB/node_modules/sharp/lib/index.js","function":null,"line":3,"method":null,"native":false}]} 2019-03-23T20:37:11.014Z [4567/610] - error: Could not locate the bindings file. Tried: → /home/nodebb/NodeBB/node_modules/sharp/build/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/compiled/10.15.3/linux/x64/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node → /home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v64-linux-x64/sharp.node {"tries":["/home/nodebb/NodeBB/node_modules/sharp/build/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/out/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/Debug/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/out/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/Release/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/build/default/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/compiled/10.15.3/linux/x64/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/release/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/debug/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/addon-build/default/install-root/sharp.node","/home/nodebb/NodeBB/node_modules/sharp/lib/binding/node-v64-linux-x64/sharp.node"]}
I've rebooted the system, and rebuilt/updated NodeBB and still have this issue.
-
@wayne-workman have you tried deleting
node_modules
and runningnpm install
again? That will rebuild the dependencies, hopefully it will work. -
@PitaJ Your suggestion did work - but I had a lot of problems doing it, partly because of my own fault. Here's what happened.
I went into
node_modules
and just did arm -rf *
in there, emptying out the dir. Then I tried to run the./nodebb install
and it failed with several dependency errors. I tried sorting them out, but decided to take a copy of thenode_modules
directory from my home-based POC nodebb box that is using node 10.15.3, and I shipped that up to the prod forums - and put it into place, fixing ownership, and starting nodebb - and that worked, and it appears now that I can upload images. Awesome.I respectfully suggest you advise folks to make backups of directories when you ask them to remove directories. The better of us of course take backups before hand - and normally I do but didn't this time (I'm too trusting). The lesser of us don't think of these things - and reminders go a long ways.
Again, thanks for your help @PitaJ you can consider this one solved!
-
@wayne-workman I said to run
npm install
, not./nodebb install