balena-io-examples / balena-nodejs-hello-world

Example of how to deploy Node code on a balena supported device.
https://www.balena.io/docs/learn/getting-started/raspberrypi3/node/
Apache License 2.0
76 stars 175 forks source link

Build fails after adding "pi-pins" library #14

Closed Temeteron closed 3 years ago

Temeteron commented 7 years ago

After trying to integrate this tutorial with the gpio project that resin provides, i installed pi-pins library and changed the tag to "latest".

The build failed with the following message:

Logs:
[Build]    make: Leaving directory '/usr/src/app/node_modules/rpio/build'
[Build]    npm notice created a lockfile as package-lock.json. You should commit this file.
[Build]    added 45 packages in 60.025s
[Build]    npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
[Build]    npm ERR!
[Build]    npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.
[Build]
[Build]    npm ERR! A complete log of this run can be found in:
[Build]    npm ERR!     /root/.npm/_logs/2017-07-18T21_25_32_580Z-debug.log
[Build]    Removing intermediate container f73ab0942b9b
[Error]    Build failed: The command '/bin/sh -c JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*' returned a non-zero code: 1
End of Logs

Obviously the problem occured by this command: RUN JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*

I solved this temporary by replacing the previous command in the Dockerfile with: `RUN npm install --force'

My project is working fine now, but i really don't know why the "default" RUN command fails.