記一次vue項目熱更新、npm i時棧溢出問題

一、有一天拉了代碼,然就運行不起來。手動刪了node_modules、package-lock.json,node-sass 。其間用npm i、npm uninstall命令一直棧溢出。開始以管理員身份運行powershell。第一步切換到公司鏡像源 npm命令不行,直接修改.npmrc裏面的registryvue

二、第二步,npm i。出現了什麼git相關問題。下載了git,配置了git的環境變量(個人git放在D盤,環境變量:D:Gitbin)
image.pngnode

三、下載完git,配置完環境變量。再次npm i。此次報錯:
vue-element-admin SSL certificate problem: unable to get local issuer certifywebpack

fatal: read error: Invalid argument npm ERR! code 128git

證書問題,百度了命令:git config --global http.sslVerify false

四、輸完3命令,再次npm i.再次報錯 code 128:
image.png
相似上面這種web

百度命令:git config --global url."https://".insteadOf git://

五、輸完4命令,再次npm i,再次報錯 code E404;
'tui-code-snippet@^1.5.0' is not in the npm registry. npm ERR! 404 You should......shell

百度命令:npm set registry https://registry.npmjs.org/

六、輸完5命令,再次npm i,再次報錯:
TypeError: Cannot read property 'vue' of undefined
檢查node_modules下面的vue-loader版本,webpack版本。npm

百度命令:npm install vue-loader

七、輸完6命令,再次npm i,裝依賴成功;npm i node-sass。npm run dev也成功,熱更新也沒問題。json

總結:原本要留着操做痕跡的,結果被運行項目被刷新掉了,這些命令是怎麼保留下來的 我忽然忘記了。。。應該是準備錄屏以前一個一個拷貝下來的,按此順序,幫助另一個同事解決熱更新問題。此問題歷時一天半終於解決,期間一度心肌梗即時感。sass

相關文章
相關標籤/搜索