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

你可能感兴趣的:(vue-cli3.0 更换vue-cli2.x)