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.

serialport.node: __strcpy_chk: symbol not found on alpine linux

See original GitHub issue

I am using alpine linux 3.3 and node 4.3.

> serialport@2.0.6 install /app/node_modules/serialport
> node-pre-gyp install --fallback-to-build

[serialport] Success: "/app/node_modules/serialport/build/Release/node-v46-linux-x64/serialport.node" is installed via remote
serialport@2.0.6 node_modules/serialport
├── bindings@1.2.1
├── async@0.9.0
├── sf@0.1.7
├── debug@2.2.0 (ms@0.7.1)
├── nan@2.0.9
└── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)

When I try to open a port I get an error:

npm ERR! Linux 3.19.0-30-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v4.3.0
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! app@1.2.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the app@1.2.0 start script 'node ./bin/www'.
npm ERR! This is most likely a problem with the app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get their info via:
npm ERR!     npm owner ls app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /app/app/npm-debug.log
module.js:435
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: Error relocating /app/app/node_modules/serialport/build/Release/node-v46-linux-x64/serialport.node: __strcpy_chk: symbol not found
    at Error (native)
    at Object.Module._extensions..node (module.js:435:18)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/app/app/node_modules/serialport/serialport.js:14:25)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)

Everything worked fine with debian jessi and node 4.3. After switching to alpine linux I get the above error.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
mhartcommented, Mar 30, 2016

So, just to summarise, the steps to get it working on Alpine are (assuming node and npm are already installed):

$ apk add --no-cache make gcc g++ python linux-headers udev
$ npm install serialport --build-from-source=serialport

(udev I imagine is optional – I guess it’s only if certain serialport functions rely on that)

1reaction
reconbotcommented, Mar 20, 2016

We’ve been cross building for arm chips on the tessel project. We don’t have the latest beta but here’s the latest version for arm.

https://packages.tessel.io/npm/serialport-2.0.6-Release.tgz

Read more comments on GitHub >

github_iconTop Results From Across the Web

node-serialport failing on alpine linux - Stack Overflow
This worked for me, running Alpine Linux in a Docker container: npm install serialport --unsafe-perm --build-from-source=serialport.
Read more >
Installing SerialPort
npm install serialport ... Historically Alpine linux had issues installing because it uses the musl standard library instead of glibc.
Read more >
Node Serialport - npm
Node.js package to access serial ports. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!
Read more >
node-red-node-serialport (node) - Node-RED Library
Node -RED nodes to talk to hardware serial ports. ... If no split character is specified, or a timeout or buffer size of...
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