1、有一天拉了代碼,然就運行不起來。手動刪了node_modules、package-lock.json,node-sass 。其間用npm i、npm uninstall命令一直棧溢出。開始以管理員身份運行powershell。第一步切換到公司鏡像源 npm命令不行,直接修改.npmrc裏面的registry
2、第二步,npm i。出現了什麼git相關問題。下載了git,配置了git的環境變量(我的git放在D盤,環境變量:D:Gitbin)
3、下載完git,配置完環境變量。再次npm i。這次報錯:
vue-element-admin SSL certificate problem: unable to get local issuer certify
fatal: read error: Invalid argument npm ERR! code 128
證書問題,百度了命令:git config --global http.sslVerify false
4、輸完3命令,再次npm i.再次報錯 code 128:
類似上面這種
百度命令:git config --global url."https://".insteadOf git://
5、輸完4命令,再次npm i,再次報錯 code E404;
'tui-code-snippet@^1.5.0' is not in the npm registry. npm ERR! 404 You should......
百度命令:npm set registry https://registry.npmjs.org/
6、輸完5命令,再次npm i,再次報錯:
TypeError: Cannot read property 'vue' of undefined
檢查node_modules下面的vue-loader版本,webpack版本。
百度命令:npm install vue-loader
7、輸完6命令,再次npm i,裝依賴成功;npm i node-sass。npm run dev也成功,熱更新也沒問題。
總結:本來要留着操作痕跡的,結果被運行項目被刷新掉了,這些命令是怎麼保留下來的 我突然忘記了。。。應該是準備錄屏之前一個一個拷貝下來的,按此順序,幫助另外一個同事解決熱更新問題。此問題歷時一天半終於解決,期間一度心肌梗即時感。