LoginSignup
1
0

More than 3 years have passed since last update.

CentOS7サーバーにデプロイしたLaravelにPuppeteerを導入する

Last updated at Posted at 2021-01-26

概要

Laravel×PuppeteerをCentOS7サーバーで稼働させる場合に役に立ちます。

node.jsのインストール方法(CentOS7)

サーバーにリポジトリを追加

$ curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -

node.jsインストール

$ sudo yum install nodejs

node.jsバージョン確認

$node -v

npmバージョン確認

$npm -v

chromeのインストール方法(CentOS7)

chromeのインストール

$ sudo yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

日本語フォントインストール

$ sudo yum install ipa-gothic-fonts ipa-mincho-fonts ipa-pgothic-fonts ipa-pmincho-fonts

chromeバージョン確認

$ google-chrome --version

Puppeteerインストール

下記をLaravelプロジェクトのpackage.jsonに追記

"puppeteer": "^5.5.0"

Puppeteerをインストール(他のnodemoduleも同時にインストールされます。)

$npm install

あとは、プロジェクトのディレクトリにpuppeteerのJSファイルを配置したら完成です!!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0