最近還是打算好好搞下vue。
搞起很久之前裝的 node.js 。肯定是要更新一下的。
首先使用命令查看當前安裝的版本:
node -v
npm -version
升級 NPM:
npm install npm -g
升級完成后可以再次查看版本以確定升級成功。
安裝全局 n 模塊:
npm install -g n
執行之后出現報錯
npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for n@6.4.0: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! notsup Valid OS: !win32 npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64 npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-04-08T03_59_18_138Z-debug.log
執行如下命令
npm install -g n --force
安裝成功
然后升級node到最新版本
n stable
然后報錯
'"bash"' 不是內部或外部命令,也不是可運行的程序或批處理文件。
百度得知可能是n里使用了linux的腳本,而windos自然沒有。
最后。。。我重新下了個 node 安裝包,覆蓋安裝了。。。。
淚眼凝噎。
這個故事告訴我們別老想着玩什么高大上的,安裝就完事了。