RockyLinuxで、標準で入る、nodeのバージョンが低いのでバージョンアップをします。
Laravelを入れてみる・・・
$ bin/composer create-project "laravel/laravel=10.*" larasite
Creating a "laravel/laravel=10.*" project at "./larasite"
Installing laravel/laravel (v10.3.3)
- Downloading laravel/laravel (v10.3.3)
- Installing laravel/laravel (v10.3.3): Extracting archive
Created project in /home/larauser/larasite
$ bin/composer create-project "laravel/laravel=10.*" larasite
Creating a "laravel/laravel=10.*" project at "./larasite"
Installing laravel/laravel (v10.3.3)
- Downloading laravel/laravel (v10.3.3)
- Installing laravel/laravel (v10.3.3): Extracting archive
Created project in /home/larauser/larasite
$ bin/composer create-project "laravel/laravel=10.*" larasite Creating a "laravel/laravel=10.*" project at "./larasite" Installing laravel/laravel (v10.3.3) - Downloading laravel/laravel (v10.3.3) - Installing laravel/laravel (v10.3.3): Extracting archive Created project in /home/larauser/larasite
↑ laravel version 10 をインストールします。
vue インストール時、nodeのバージョンが低い
$ cd larasite/
$ npm install --save-dev vue
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'laravel-vite-plugin@1.0.2',
npm WARN EBADENGINE required: { node: '^18.0.0 || >=20.0.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'vite@5.2.8',
npm WARN EBADENGINE required: { node: '^18.0.0 || >=20.0.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'rollup@4.14.0',
npm WARN EBADENGINE required: { node: '>=18.0.0', npm: '>=8.0.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
$ cd larasite/
$ npm install --save-dev vue
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'laravel-vite-plugin@1.0.2',
npm WARN EBADENGINE required: { node: '^18.0.0 || >=20.0.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'vite@5.2.8',
npm WARN EBADENGINE required: { node: '^18.0.0 || >=20.0.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'rollup@4.14.0',
npm WARN EBADENGINE required: { node: '>=18.0.0', npm: '>=8.0.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
$ cd larasite/ $ npm install --save-dev vue npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'laravel-vite-plugin@1.0.2', npm WARN EBADENGINE required: { node: '^18.0.0 || >=20.0.0' }, npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'vite@5.2.8', npm WARN EBADENGINE required: { node: '^18.0.0 || >=20.0.0' }, npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' } npm WARN EBADENGINE } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'rollup@4.14.0', npm WARN EBADENGINE required: { node: '>=18.0.0', npm: '>=8.0.0' }, npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' } npm WARN EBADENGINE }
↑vueをインストールしようとすると、nodeのバージョンが低いよ!
という警告メッセージが出てきます。
$ node --version
v16.20.2
$ node --version
v16.20.2
$ node --version v16.20.2
↑ Rocky linux 9.3 の dnf コマンドでインストールすると、標準では、
v16.xx.xx
が、入るようです。
node の入れ替え
インストール済みのnodejs を削除します。
# dnf remove nodejs
(略)
Removed:
nodejs-1:16.20.2-4.el9_3.x86_64 nodejs-docs-1:16.20.2-4.el9_3.noarch nodejs-full-i18n-1:16.20.2-4.el9_3.x86_64 nodejs-libs-1:16.20.2-4.el9_3.x86_64
npm-1:8.19.4-1.16.20.2.4.el9_3.x86_64
Complete!
# dnf remove nodejs
(略)
Removed:
nodejs-1:16.20.2-4.el9_3.x86_64 nodejs-docs-1:16.20.2-4.el9_3.noarch nodejs-full-i18n-1:16.20.2-4.el9_3.x86_64 nodejs-libs-1:16.20.2-4.el9_3.x86_64
npm-1:8.19.4-1.16.20.2.4.el9_3.x86_64
Complete!
# dnf remove nodejs (略) Removed: nodejs-1:16.20.2-4.el9_3.x86_64 nodejs-docs-1:16.20.2-4.el9_3.noarch nodejs-full-i18n-1:16.20.2-4.el9_3.x86_64 nodejs-libs-1:16.20.2-4.el9_3.x86_64 npm-1:8.19.4-1.16.20.2.4.el9_3.x86_64 Complete!
↑nodejs の、version 16 が削除されました。
# curl -sL https://rpm.nodesource.com/setup_18.x | sudo -E bash -
XXXX-XX-XX XX:XX:XX - Cleaning up old repositories...
XXXX-XX-XX XX:XX:XX - Old repositories removed
XXXX-XX-XX XX:XX:XX - Supported architecture: x86_64
XXXX-XX-XX XX:XX:XX - Added N|Solid repository for LTS version: 18.x
XXXX-XX-XX XX:XX:XX - dnf available, updating...
Node.js Packages for Linux RPM based distros - x86_64 2.9 MB/s | 865 kB 00:00
N|Solid Packages for Linux RPM based distros - x86_64 799 kB/s | 228 kB 00:00
Metadata cache created.
XXXX-XX-XX XX:XX:XX - Repository is configured and updated. Run 'dnf install nodejs -y' to complete the installation.
# curl -sL https://rpm.nodesource.com/setup_18.x | sudo -E bash -
XXXX-XX-XX XX:XX:XX - Cleaning up old repositories...
XXXX-XX-XX XX:XX:XX - Old repositories removed
XXXX-XX-XX XX:XX:XX - Supported architecture: x86_64
XXXX-XX-XX XX:XX:XX - Added N|Solid repository for LTS version: 18.x
XXXX-XX-XX XX:XX:XX - dnf available, updating...
Node.js Packages for Linux RPM based distros - x86_64 2.9 MB/s | 865 kB 00:00
N|Solid Packages for Linux RPM based distros - x86_64 799 kB/s | 228 kB 00:00
Metadata cache created.
XXXX-XX-XX XX:XX:XX - Repository is configured and updated. Run 'dnf install nodejs -y' to complete the installation.
# curl -sL https://rpm.nodesource.com/setup_18.x | sudo -E bash - XXXX-XX-XX XX:XX:XX - Cleaning up old repositories... XXXX-XX-XX XX:XX:XX - Old repositories removed XXXX-XX-XX XX:XX:XX - Supported architecture: x86_64 XXXX-XX-XX XX:XX:XX - Added N|Solid repository for LTS version: 18.x XXXX-XX-XX XX:XX:XX - dnf available, updating... Node.js Packages for Linux RPM based distros - x86_64 2.9 MB/s | 865 kB 00:00 N|Solid Packages for Linux RPM based distros - x86_64 799 kB/s | 228 kB 00:00 Metadata cache created. XXXX-XX-XX XX:XX:XX - Repository is configured and updated. Run 'dnf install nodejs -y' to complete the installation.
↑リポジトリが更新されました。
# dnf install nodejs
(略)
Installed:
nodejs-2:18.20.1-1nodesource.x86_64
Complete!
# dnf install nodejs
(略)
Installed:
nodejs-2:18.20.1-1nodesource.x86_64
Complete!
# dnf install nodejs (略) Installed: nodejs-2:18.20.1-1nodesource.x86_64 Complete!
↑ nodejs version 18 がインストールされました。
# node --version
v18.20.1
# node --version
v18.20.1
# node --version v18.20.1
↑ nodejs が、version 18 になりました。
vueのインストールし直し
$ npm install --save-dev vue
added 38 packages, and audited 39 packages in 7s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm install --save-dev vue
added 38 packages, and audited 39 packages in 7s
6 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ npm install --save-dev vue added 38 packages, and audited 39 packages in 7s 6 packages are looking for funding run `npm fund` for details found 0 vulnerabilities
↑ vue インストール時に警告が出なくなりました。