vue-cli3.0 更換vue-cli2.x

從2.x升級到3.0後,項目需求又需要換回2.x
npm uninstall -g @vue/cli
npm install -g vue-cli

npm install -g vue-cli
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/vue-cli/node_modules/absolute
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/vue-cli/node_modules/ansi-escapes
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/vue-cli/node_modules/ansi-regex
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/vue-cli/node_modules/ansi-wrap

解決辦法
切換到目錄 /usr/local/lib/ 刪除整個node-modules目錄
rm -rf node_modules
再重新下載node vue-cli

當啓動項目

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
 @ ./~/[email protected]@vue-style-loader!./~/[email protected]@css-loader!./~/[email protected]@vue-loader/lib/style-rewriter.js?id=data-v-f32f70e2!./~/[email protected]@sass-loader!./~/[email protected]@vue-loader/lib/selector.js?type=styles&index=0!./src/components/system/infoManage/components/tipsWrap.vue 4:14-369 13:2-17:4 14:20-375

ERROR in Missing binding /Users/mirror/Desktop/web-project/h5-hotel-manage-plarform/web_source/pc/node_modules/[email protected]@node-sass/vendor/darwin-x64-64/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 10.x

Found bindings for the following environments:
  - OS X 64-bit with Node.js 9.x

node-sass兼容不node v8的版本報錯
執行

cnpm i node-sass -D
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章