スポンサーリンク

gatsby-wordpressブログのgatsbyバージョンをアップデートしました

プログラミングカテゴリ プログラミング

gatsbyがメジャーアップデートしました。
v2からv3です。

Gatsby v3 Incremental Builds in OSS, new Gatsby Image, and more | Gatsby
We are excited to announce Gatsby v3.0! This new version of Gatsby’s core framework introduces massive improvement to the developer and user experience.

意外とサクッとできました。この機会に、gatsbyブログをもう少しいい感じにカスタマイズしていきたいと思います。どんなふうにしたかをメモにして残します。

スポンサーリンク

何はともあれ新しいgatsbyにアップデート

% npm install gatsby@latest

@latest 最新バージョンを指定しているのです。

依存関係の更新が必要なものをチェック

% npm outdated

~/environment/bochibochi-blog npm outdated +[main]
Package Current Wanted Latest Location
@wordpress/block-library 2.28.2 2.29.1 2.29.1 gatsby-starter-wordpress-blog
gatsby-image 2.11.0 2.11.0 3.2.0 gatsby-starter-wordpress-blog
gatsby-plugin-manifest 2.12.0 2.12.1 3.2.0 gatsby-starter-wordpress-blog
gatsby-plugin-offline 3.10.0 3.10.2 4.2.0 gatsby-starter-wordpress-blog
gatsby-plugin-react-helmet 3.10.0 3.10.0 4.2.0 gatsby-starter-wordpress-blog
gatsby-plugin-sharp 2.14.1 2.14.3 3.2.1 gatsby-starter-wordpress-blog
gatsby-source-filesystem 2.11.0 2.11.1 3.2.0 gatsby-starter-wordpress-blog
gatsby-source-wordpress 4.0.0 4.0.6 5.2.3 gatsby-starter-wordpress-blog
gatsby-transformer-sharp 2.12.0 2.12.1 3.2.0 gatsby-starter-wordpress-blog
lodash 4.17.20 4.17.21 4.17.21 gatsby-starter-wordpress-blog
react 17.0.1 17.0.2 17.0.2 gatsby-starter-wordpress-blog
react-dom 17.0.1 17.0.2 17.0.2 gatsby-starter-wordpress-blog
react-helmet 5.2.1 5.2.1 6.1.0 gatsby-starter-wordpress-blog

まとめて更新

updateをチェックしてまとめてアップデートしてくれる’npm-check-updates’というツールを使います。そのツールをインストールします。

% npm install -g npm-check-updates

これで、ncuコマンドを使えるようになりました。

% ncu -u

ちょっと乱暴ですが、まとめてアップデートのコマンド。これで、package.jsonの中身が最新版になります。

% npm install

で、パッケージを最新版にインストールしなおします。

% npm outdated

で確認すると、何も出てこなかったので、続けて

% gatsby develop

すると無事サーバーが起動して、ブログが表示できました。

コメント

タイトルとURLをコピーしました