Deepin15.4vue
注:①文中提到的路径都要根据本身实际路径进行修改 ②非Linux用户跳过 <设置软链接> 部分 ③cnpm做用与npm一致,只是cnpm下载国内资源,下载更快一下 node
$ ln -s /home/maskerk/vue/bin/node /usr/local/bin $ ln -s /home/maskerk/vue/bin/npm /usr/local/bin
执行命令webpack
$ node -v $ npm -v
显示正常说明设置成功git
$ npm install -g cnpm --registry=https://registry.npm.taobao.org //设置软链接 $ ln -s /home/maskerk/vue/bin/cnpm /usr/local/bin
$ cnpm install vue //设置软链接 $ ln -s /home/maskerk/vue/bin/vue /usr/local/bin
$ cnpm install --global vue-cli
# 建立一个基于 webpack 模板的新项目 $ vue init webpack my-project # 这里须要进行一些配置,默认回车便可 This will install Vue 2.x version of the template. For Vue 1.x use: vue init webpack#1.0 my-project ? Project name my-project ? Project description A Vue.js project ? Author runoob <test@runoob.com> ? Vue build standalone ? Use ESLint to lint your code? Yes ? Pick an ESLint preset Standard ? Setup unit tests with Karma + Mocha? Yes ? Setup e2e tests with Nightwatch? Yes vue-cli · Generated "my-project". To get started: cd my-project npm install npm run dev Documentation can be found at https://vuejs-templates.github.io/webpack
$ cd my-project $ cnpm install
$ cnpm run dev
Listening at http://localhost:8080github
在执行'''cnpm install'''命令时,出现错误‘webpack-dev-server不是内部或外部命令’
web
处理方法: cnpm install webpack-dev-server
执行"cnpm install"出现错误
vue-cli
处理方法: 方案一: cnpm rebuild node-sass #不放心能够从新安装下 cnpm install 方案二: npm update npm install nodejs node_modules/node-sass/scripts/install.js npm rebuild node-sass 通常只要执行方案一就够了。 而后再运行,OK。
使用 style lang="stylus" 报错npm
"此时不单单须要cnpm install stylus-loader.还须要cnpm install stylus " 这两步基本就能够解决了sass