2019年8月18日日曜日

How to run puppetter on arm64 linux.

This is how to run puppetter on arm64 linux (Termux arch linux).

1. Install chromium.
> pacman -S chromium

2. Install chromium's dependencies.
> pacman -S <chromium depend libraries>

3. Install puppetter from npm.
> npm install puppetter

4. Use arm64 chromium for puppetter.
puppetter on npm have only x86_64 chrome binary.
So, make symblic link and use arm64 chromium.

> cd node_modules/puppeteer/.local-chromium/linux-674921/chrome-linux/
> ln -s /usr/bin/chromium ./chrome

How to run tfjs-node on arm64 linux.

This is how to run tensorflow.js for node.js on arm64 linux (termux arch linux).

1. Do node-pre-gyp on arm64 linux.

> npm install @tensowflow/tfjs-node
> cd node_modules/\@tensorflow/tfjs-node
> npx node-pre-gyp -v rebuild

2. Use arm64 libtensorflow.so.
You have to build it your self.

> cd /usr/local/lib
> ln -s libtensorflow.so libtensorflow.so.1