前端環(huán)境部署調(diào)研
調(diào)研情況
image.png
To-Do
- [ ] readme 添加 commit 信息規(guī)范
- [ ] 鼓勵大家用yarn
前端框架錯(cuò)誤
錯(cuò)誤1: instance is not defined
error in./src/utils/axios. js syntax Error: SyntaxError: teacher-frontend-master(src\utils axios. js: Export 'instance' is not defined(36: 4)
34 VueAxios,
35 // eslint-disable-next-line no-undef
36 instance as axios
37}
@. /src/utils/request. js 4: 0-35 64: 12-20 @src/maln. ]S @multi(webpack)-dev-server/client?http://192.168.56.1:8080/sockjs node(webpack)/hot/dev-server.js ./src/main.js
順便一提, 使用npm偶爾也會遇到vue-cli-server不是命令的情況, 這種情況rm node_modules 重新yarn install就可以了
錯(cuò)誤2: 找不到python2
gyp verb command configure[]
gyp verb check python checking for Python executable python in the PATH
gyp verb which failed Error: not found: Python2
前端框架錯(cuò)誤解決
錯(cuò)誤1: instance is not defined
因?yàn)樵趓eadme 中沒有鼓勵大家使用yarn, 而且寫了npm的備用方案, 導(dǎo)致使用npm的同學(xué)都遇到了這個(gè)問題.
在這里鼓勵大家使用yarn替代npm, 如果覺得yarn install速度不行, 可以嘗試使用cnpm install 其他時(shí)候盡量使用yarn
錯(cuò)誤2: 找不到python2
npm install --global --production windows-build-tools
npm install --global node-gyp
# 執(zhí)行后重新安裝yarn
總結(jié)
實(shí)際上調(diào)研中出現(xiàn)的所有狀況都是使用npm導(dǎo)致的, 這是我們寫readme時(shí)不嚴(yán)謹(jǐn)導(dǎo)致的錯(cuò)誤. 實(shí)際上這些錯(cuò)誤都可以通過刪除node_modules/ 重新yarn install來解決問題