Why can’t you stop buying 618?From the technical dimension to explore>>>
> @ start /
> node app.js
/node_modules/bindings/bindings.js:88
throw e
^
Error: /node_modules/node-rdkafka/build/Release/node-librdkafka.node: invalid ELF header
at Object.Module._extensions..node (module.js:664:18)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at bindings (/node_modules/bindings/bindings.js:81:44)
at Object.<anonymous> (/node_modules/node-rdkafka/librdkafka.js:10:32)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start 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/2018-04-01T14_49_31_971Z-debug.log```
When using Kafka package to deploy with docker in nodejs, the above errors will appear
The solution is to build the dockerfile as follows:
FROM node:8.11
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm install
RUN npm install node-rdkafka --no-package-lock
CMD [ "npm", "start" ]
Remove the node rdkafka dependency from package. JSON
Then it is executed separately:
RUN npm install node-rdkafka --no-package-lock
That’s it
Similar Posts:
- How to Solve Error: ENOENT: no such file or directory, scandir ‘..\node_modules\node-sass\vendor’
- After installing nodejs, running NPM – V will cause (module. JS: 339 throw err..) error. Solution
- Completely Uninstall Node.js from Mac OS X
- Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 7.x
- [Solved] Nodejs Error: Cannot find module ‘express’
- Module build failed: Error: Cannot find module ‘node-sass’
- [Solved] Vue installs less Error: Failed to compile with 1 errors
- How to Solve Error: Cannot find module ‘gulp-sass’
- How to Solve ReferenceError: internalBinding is not defined
- [xviz] ./scripts/run-kitti-example.sh Excute Error: gyp ERR! Node-gyp failed to build your package.