I installed node js on raspberry pi 3 when I install electron js with the following command:
sudo npm install -g electron --unsafe-perm=true --allow-root
I get the following output:
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron/cli.js
> core-js@3.4.1 postinstall /usr/local/lib/node_modules/electron/node_modules/core-js
> node postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> electron@7.1.1 postinstall /usr/local/lib/node_modules/electron
> node install.js
(node:11878) UnhandledPromiseRejectionWarning: HTTPError: Response code 404 (Not Found)
at EventEmitter.<anonymous> (/usr/local/lib/node_modules/electron/node_modules/got/source/as-stream.js:35:24)
at EventEmitter.emit (events.js:210:5)
at module.exports (/usr/local/lib/node_modules/electron/node_modules/got/source/get-response.js:22:10)
at ClientRequest.handleResponse (/usr/local/lib/node_modules/electron/node_modules/got/source/request-as-event-emitter.js:155:5)
at Object.onceWrapper (events.js:300:26)
at ClientRequest.emit (events.js:215:7)
at ClientRequest.origin.emit (/usr/local/lib/node_modules/electron/node_modules/@szmarczak/http-timer/source/index.js:37:11)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
at TLSSocket.socketOnData (_http_client.js:456:22)
(node:11878) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11878) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
+ electron@7.1.1
added 86 packages from 90 contributors in 39.202s
How can I rectify this problem.
To solve this I created a ".npmrc" file in the project root directory and added:
arch=armv7l
You can get arch from:
uname -m