安装 dva-cli

win10,前提是正确安装了nodejs和npm,npm安装请看:https://blog.csdn.net/u010002184/article/details/82596389

cmd下输入:

1 npm install dva-cli -g  应该会运行3分钟左右

2 dva -v  查看版本,如果安装成功会输出版本号

3 dva new dva-quickstart   应该会运行2分钟左右,会在cmd的路径下创建文件夹dva-quickstart

4 cd dva-quickstart

5 npm start

记录如下:

D:\Program Files\antd>npm install dva-cli -g
npm WARN deprecated win-spawn@2.0.0: use [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn) or [cross-spawn-async](https://github.com/IndigoUnited/node-cross-spawn-async) instead.
npm WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
[ .................] / fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] / fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] / fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] / fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] / fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] - fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] | fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] | fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] | fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] | fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] | fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] | fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] | fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recom[ .................] / fetchMetadata: WARN deprecated babel-preset-es2015@6.24.1: ?  Thanks for using Babel: we recomnpm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
C:\Users\liuyazhou\AppData\Roaming\npm\dva -> C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\bin\dva
+ dva-cli@0.9.2
added 423 packages from 277 contributors in 315.552s
a
D:\Program Files\antd>
D:\Program Files\antd>dva
Usage: dva <command> [options]

Options:

  -h, --help  output usage information
  Commands:

    init           Init a new dva application in the current folder
    new            Creates a new application
    generate       Generates new code (short-cut alias: "g")

  All commands can be run with -h (or --help) for more information.

D:\Program Files\antd>dva -v
dva-cli version 0.9.2

D:\Program Files\antd>dva new dva-quickstart
C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\bin\dva-new
Creating a new Dva app in D:\Program Files\antd\dva-quickstart.

      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\.editorconfig
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\.eslintrc
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\.roadhogrc.mock.js
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\.webpackrc
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\gitignore
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\package.json
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\mock\.gitkeep
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\index.css
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\index.js
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\router.js
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\public\index.html
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\assets\yay.jpg
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\models\example.js
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\components\Example.js
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\routes\IndexPage.css
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\routes\IndexPage.js
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\utils\request.js
      create  C:\Users\liuyazhou\AppData\Roaming\npm\node_modules\dva-cli\boilerplates\app\src\services\example.js
      rename  gitignore -> .gitignore
         run  npm install
use npm: npm.cmd
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated hoek@2.16.3: The major version is no longer supported. Please update to 4.x or newer
npm WARN deprecated nomnom@1.6.2: Package no longer supported. Contact support@npmjs.com for more info.

> husky@0.12.0 install D:\Program Files\antd\dva-quickstart\node_modules\husky
> node ./bin/install.js

husky
setting up hooks
Can't find .git directory, skipping Git hooks installation

> uglifyjs-webpack-plugin@0.4.6 postinstall D:\Program Files\antd\dva-quickstart\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN eslint-config-react-app@2.1.0 requires a peer of babel-eslint@^7.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN babel-loader@8.0.2 requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-export-namespace@7.0.0-beta.32 requires a peer of @babel/core@7.0.0-beta.32 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-export-default@7.0.0-beta.32 requires a peer of @babel/core@7.0.0-beta.32 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-export-extensions@7.0.0-beta.32 requires a peer of @babel/core@7.0.0-beta.32 but none is installed. You must install peer dependencies yourself.
npm WARN ts-jest-babel-7@22.0.7 requires a peer of jest@^22.0.1 || ^22.1.0-alpha.1 || ^23.0.0-alpha.1 but none is installed. You must install peer dependencies yourself.
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"})

added 1888 packages from 981 contributors and audited 41891 packages in 138.855s
found 4 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
npm WARN @babel/plugin-proposal-export-default@7.0.0-beta.32 requires a peer of @babel/core@7.0.0-beta.32 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-proposal-export-namespace@7.0.0-beta.32 requires a peer of @babel/core@7.0.0-beta.32 but none is installed. You must install peer dependencies yourself.
npm WARN @babel/plugin-syntax-export-extensions@7.0.0-beta.32 requires a peer of @babel/core@7.0.0-beta.32 but none is installed. You must install peer dependencies yourself.
npm WARN babel-loader@8.0.2 requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@2.1.0 requires a peer of babel-eslint@^7.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN ts-jest-babel-7@22.0.7 requires a peer of jest@^22.0.1 || ^22.1.0-alpha.1 || ^23.0.0-alpha.1 but none is installed. You must install peer dependencies yourself.
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"})

+ dva@2.4.0
updated 1 package and audited 41891 packages in 12.752s
found 4 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
npm.cmd install end

Success! Created dva-quickstart at D:\Program Files\antd\dva-quickstart.

Inside that directory, you can run several commands:
  * npm start: Starts the development server.
  * npm run build: Bundles the app into dist for production.
  * npm test: Run test.

We suggest that you begin by typing:
  cd D:\Program Files\antd\dva-quickstart
  npm start

Happy hacking!

D:\Program Files\antd>cd dva-quickstart

D:\Program Files\antd\dva-quickstart>npm start

> @ start D:\Program Files\antd\dva-quickstart
> roadhog server

  build [==                  ] 10%

Starting the development server...

Build completed in 3.22s
Compiled successfully!

You can now view Your App in the browser.

  Local:            http://localhost:8000/
  On Your Network:  http://192.168.0.104:8000/

Note that the development build is not optimized.
To create a production build, use npm run build.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

二十六画生的博客

你的鼓励是我创作最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值