AntDesign安装和环境配置

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

一直点击next即可,可参考:Node.js安装及环境配置之Windows篇 https://blog.csdn.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/

完整的记录如下:


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

> spawn-sync@1.0.15 postinstall C:\Users\lyzh\AppData\Roaming\npm\node_modu
les\antd-init\node_modules\spawn-sync
> node postinstall

+ antd-init@2.0.6
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 babel-preset-es2015@6.3.13: �  Thanks for using Babel: we re
commend using babel-preset-env now: please read babeljs.io/env to update!
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Bro
wserslist >3.0 config used in other tools.
npm WARN deprecated formatio@1.1.1: 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 npm@latest -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 npm@latest -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 npm@latest -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 npm@latest -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 npm@latest -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 npm@latest -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 npm@latest -g` to upgrade your npm version, and then `npm audit`
to get more info.

> pre-commit@1.2.2 install C:\Users\lyzh\antd-demo\node_modules\pre-commit
> node install.js


> spawn-sync@1.0.15 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 eslint-config-airbnb@12.0.0 requires a peer of eslint-plugin-import@^1.
16.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-airbnb-base@8.0.0 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: fsevents@1.2.4 (node_modules\fse
vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)

added 928 packages in 148.716s
npm install end

---

antd-init@2 仅适用于学习和体验 antd,如果你要开发项目,推荐使用 dva-cli 进行项目
初始化。dva 是一个基于 react 和 redux 的轻量应用框架,概念来自 elm,支持 side ef
fects、热替换、动态加载等,已在生产环境广泛应用。
antd-init@2 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.
 

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页