npm install --verbose
安裝依賴的時,出現以下警告vue
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32 npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
這不是什麼真的有問題,只是你的某些包依賴fsevents
包,而fsevents
包是MacOS系統下,在Windows/Linux下會提示警告,但不會安裝.node
可是強迫症患者表示不能接受,換個角度看釋疑,意味着fsevents
在MacOS下是必須的,而在Windows/Linux下是可選的.ios
那麼咱們能夠經過package.json
的optionalDependencies
來規避警告,而後npm install --no-optional --verbose
不安裝可選項便可.vue-router
參考以下:vuex
{ "dependencies": { "axios": "^0.18.0", "echarts": "^4.2.0-rc.2", "element-ui": "^2.4.11", "screenfull": "^3.3.3", "vue": "^2.5.17", "vue-router": "^3.0.1", "vuex": "^3.0.1" }, "devDependencies": { "@vue/cli-plugin-babel": "^3.0.5", "@vue/cli-service": "^3.0.5", "less": "^3.0.4", "less-loader": "^4.1.0", "vue-template-compiler": "^2.5.17" }, "optionalDependencies": { "fsevents": "*" } }