Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

478
Vistas
Error: No native build was found for platform when using node pkg with serialport

I am using the node pkg package to package up my node app and create a native executable. But for some reason when I use the serialport npm package in my app, it compiles but when I try to run it it throws this error (no matter what platform I build for):

$ ./app

pkg/prelude/bootstrap.js:1876
      throw error;
      ^

Error: No native build was found for platform=linux arch=x64 runtime=node abi=83 uv=1 libc=glibc node=14.19.2
    loaded from: /snapshot/pkg/node_modules/@serialport/bindings-cpp

    at Function.path (/snapshot/pkg/node_modules/node-gyp-build/index.js:60:9)
    at load (/snapshot/pkg/node_modules/node-gyp-build/index.js:22:30)
    at Object.<anonymous> (/snapshot/pkg/node_modules/@serialport/bindings-cpp/dist/load-bindings.js:10:46)
    at Module._compile (pkg/prelude/bootstrap.js:1930:22)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Module.require (pkg/prelude/bootstrap.js:1855:31)
    at require (internal/modules/cjs/helpers.js:101:18)

Here is my package.json

{
  "name": "pkg",
  "version": "1.0.0",
  "dependencies": {
    "serialport": "^10.4.0"
  }
}

And here is my app.js

const { SerialPort } = require('serialport')

const port = new SerialPort({
  path: '/dev/ttyUSB0',
  baudRate: 19200,
})

console.log('Serial port opened successfully!')

And this is how I build:

$ pkg app.js --target=node14-linux-x64
> pkg@5.7.0
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda