vue-cli3.0 更换vue-cli2.x
2019-02-18 本文已影响0人
暴烈的海胆
从2.x升级到3.0后,项目需求又需要换回2.x
npm uninstall -g @vue/cli
npm install -g vue-cli
npm install -g vue-cli
npm WARN deprecated coffee-script@1.12.7: 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.
@ ./~/_vue-style-loader@1.0.0@vue-style-loader!./~/_css-loader@0.25.0@css-loader!./~/_vue-loader@10.3.0@vue-loader/lib/style-rewriter.js?id=data-v-f32f70e2!./~/_sass-loader@4.1.1@sass-loader!./~/_vue-loader@10.3.0@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/_node-sass@4.9.2@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