[精讚] [會員登入]

[Rocky9] 安裝node.js 18, node.js 20

原本的nodejs16在使用 quasar dev時出現錯誤,得升級成18版以上

分享完整連結 //n.sfs.tw/m10935

分享連結 [Rocky9] 安裝node.js 18, node.js 20@精讚
(文章歡迎轉載,請尊重版權註明連結來源)
2024-04-15 15:28:22 By 張○○

原本的nodejs16在使用 quasar dev時出現錯誤,得升級成18版以上。

查看 node js的版本

# node -v

移除原有node.js

# dnf remove nodejs

查看目前提供的版本

# dnf module list nodejs

Last metadata expiration check: 2:57:33 ago on Mon 15 Apr 2024 12:19:40 PM CST.
Rocky Linux 9 - AppStream
Name               Stream             Profiles                                             Summary                      
nodejs             18 [e]             common [d] [i], development, minimal, s2i            Javascript runtime           
nodejs             20                 common [d], development, minimal, s2i                Javascript runtime
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

 

安裝18 版

# dnf module install nodejs:18/commin

安裝 20 版

# dnf module install nodejs:20/commin

錯誤排除

如果安裝時出現這樣的錯誤

The operation would result in switching of module 'nodejs' stream '18' to stream '20'
Error: It is not possible to switch enabled streams of a module unless explicitly enabled via configuration option module_stream_switch.
It is recommended to rather remove all installed content from the module, and reset the module using 'dnf module reset <module_name>' command. After you reset the module, you can install the other stream.

請清空 dnf的設定

# dnf module reset nodejs

Last metadata expiration check: 3:04:50 ago on Mon 15 Apr 2024 12:19:40 PM CST.
Dependencies resolved.
========================================================================================================================
 Package                     Architecture               Version                       Repository                   Size
========================================================================================================================
Disabling module profiles:
 nodejs/common                                                                                                         
Resetting modules:
 nodejs                                     
Transaction Summary
========================================================================================================================

再安裝即可

# dnf module install nodejs:20/common

 

 

 

相關連結

https://nodejs.org/en/download/package-manager/all#centos-fedora-and-red-hat-enterprise-linux

END
你可能有興趣

[Rocky9] 安裝node.js 18, node.js 20

原本的nodejs16在使用 quasar dev時出現錯誤,得升級成18版以上

[SSL] Could not read certificate from server.cer 的錯誤排除

在轉換ssl憑證時,出現無法讀取的錯誤,可是怎麼看憑證都很正常,該怎麼解決?

[Linux] 如何能知道我是什麼時候安裝系統的?

linux想知道什麼時候裝系統的? 不必憑記憶。

地圖填色的網站

我們想為國家填色不需要小畫家,這個網站能幫助你

[Linux] 列出所有目錄及所占空間的方法

想知道目錄下的所有目錄所占的空間大小?

[Linux] grep 排除特定字串

使用 -v 參數可以讓grep排除特定字串的方法