AntDesign安装和环境配置

https://nodejs.org/en/ 下载node.js 并安装

AntDesign安装和环境配置

一直点击next即可,可参考:Node.js安装及环境配置之Windows篇 https://blog.****.net/qq_26562641/article/details/72235585

2 无需配置环境变量,cmd下输入:node --version 输出版本号则表示node.js安装成功,目前nodejs已集成npm

3 cmd下输入:npm -v  输出版本号则表示npm安装成功。cmd下输入node即进入nodejs的开发模式,输入 console.log(123)则会输出123,两次ctrl+c退出开发模式

4 cmd下输入:npm install antd-init -g 安装antdesign,一分钟就好

5 cmd下输入:mkdir antd-demo && cd antd-demo

6 cmd下输入:antd-init  大概要2分多钟

7 cmd下输入:npm start

8 访问:http://127.0.0.1:8000/

AntDesign安装和环境配置

完整的记录如下:


C:\Users\lyzh>node --version
v8.11.4

C:\Users\lyzh>npm -v
5.6.0

C:\Users\lyzh>node
> console.log(123)
123
undefined
> console.log('加油')
加油
undefined
> exit
ReferenceError: exit is not defined
> quit
ReferenceError: quit is not defined
>
>
>
>
(To exit, press ^C again or type .exit)
>

C:\Users\lyzh>
C:\Users\lyzh>npm install antd-init -g
C:\Users\lyzh\AppData\Roaming\npm\antd-init -> C:\Users\lyzh\AppData\R
oaming\npm\node_modules\antd-init\bin\antd-init

> [email protected] postinstall C:\Users\lyzh\AppData\Roaming\npm\node_modu
les\antd-init\node_modules\spawn-sync
> node postinstall

+ [email protected]
added 140 packages in 27.11s

C:\Users\lyzh>mkdir antd-demo && cd antd-demo

C:\Users\lyzh\antd-demo>antd-init
Write .\gitignore
Write .\index.css
Write .\index.html
Write .\index.js
Write .\package.json
Write .\webpack.config.js
use npm: npm
npm WARN deprecated [email protected]: �  Thanks for using Babel: we re
commend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Bro
wserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: This package is unmaintained. Use @sinonjs/f
ormatio instead
npm WARN notice [SECURITY] mime has the following vulnerability: 1 moderate. Go
here for more details: https://nodesecurity.io/advisories?search=mime&version=1.
3.6 - Run `npm i [email protected] -g` to upgrade your npm version, and then `npm audit
` to get more info.
npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here
 for more details: https://nodesecurity.io/advisories?search=debug&version=2.6.8
 - Run `npm i [email protected] -g` to upgrade your npm version, and then `npm audit` t
o get more info.
npm WARN notice [SECURITY] debug has the following vulnerability: 1 low. Go here
 for more details: https://nodesecurity.io/advisories?search=debug&version=2.0.0
 - Run `npm i [email protected] -g` to upgrade your npm version, and then `npm audit` t
o get more info.
npm WARN notice [SECURITY] negotiator has the following vulnerability: 1 high. G
o here for more details: https://nodesecurity.io/advisories?search=negotiator&ve
rsion=0.4.9 - Run `npm i [email protected] -g` to upgrade your npm version, and then `n
pm audit` to get more info.
npm WARN notice [SECURITY] ms has the following vulnerability: 1 moderate. Go he
re for more details: https://nodesecurity.io/advisories?search=ms&version=0.6.2
- Run `npm i [email protected] -g` to upgrade your npm version, and then `npm audit` to
 get more info.
npm WARN notice [SECURITY] growl has the following vulnerability: 1 critical. Go
 here for more details: https://nodesecurity.io/advisories?search=growl&version=
1.9.2 - Run `npm i [email protected] -g` to upgrade your npm version, and then `npm aud
it` to get more info.
npm WARN notice [SECURITY] fresh has the following vulnerability: 1 high. Go her
e for more details: https://nodesecurity.io/advisories?search=fresh&version=0.3.
0 - Run `npm i [email protected] -g` to upgrade your npm version, and then `npm audit`
to get more info.

> [email protected] install C:\Users\lyzh\antd-demo\node_modules\pre-commit
> node install.js


> [email protected] postinstall C:\Users\lyzh\antd-demo\node_modules\spawn-
sync
> node postinstall

npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN [email protected] requires a peer of [email protected]^1.
16.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of eslint-plugin-import
@^1.16.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

added 928 packages in 148.716s
npm install end

---

[email protected] 仅适用于学习和体验 antd,如果你要开发项目,推荐使用 dva-cli 进行项目
初始化。dva 是一个基于 react 和 redux 的轻量应用框架,概念来自 elm,支持 side ef
fects、热替换、动态加载等,已在生产环境广泛应用。
[email protected] is only for experience antd. If you want to create projects, it's be
tter to init with dva-cli. dva is a redux and react based application framework.
 elm concept, support side effects, hmr, dynamic load and so on.

Usage:

npm install dva-cli -g
dva new myapp
cd myapp
npm start

Visit https://github.com/dvajs/dva to learn more.

C:\Users\lyzh\antd-demo>npm start

> @ start C:\Users\lyzh\antd-demo
> dora --plugins webpack

           dora: listened on 8000
�  246/246 build modules
webpack: bundle build is now finished.