ES6快速入门
原创约 512 字大约 2 分钟...
ES6快速入门
注意
本博文仅供学术研究和交流参考,严禁将其用于商业用途。如因违规使用产生的任何法律问题,使用者需自行负责。
概念
. 常量 . 作用域 . 箭头函数 . 默认参数 . 对象代理
环境准备
- 安装
window:
1.安装git
2. 执行git clone https://github.com/cucygh/es6-webpack.git
3. cd es6-webpack && npm install
Mac ox
1. 执行git clone https://github.com/cucygh/es6-webpack.git
2. cd es6-webpack && npm install
- 拓展:
- 若进入某个文件夹的名字中间有空格 则需在文件名上加个单引号就可以了,如 cd 'program files'

- 下载nodejs
- 傻瓜式的下一步下一步安装(备注安装路径我是安装在D盘)
- node -v检查是否安装成功
- npm config set prefix "D:\Program Files\nodeJs\node_global"
- npm config set cache"D:\Program Files\nodeJs\node_cache"

- 完成之后会看到对应路径多出两文件夹

- 添加系统环境变量
在系统环境变量添加NODE_PATH,输入路径为:
D:\Program Files\nodeJs\node_global
操作如下:我的电脑右击,打开属性->高级系统设置->
环境变量->新建(系统变量下)->输入变量名NODE_PATH->
变量值:输入上面路径,确定即可。

- 安装express
npm install -g express-generator

- 可以看到node_global/node_modules下有express了,如图:


我也不知道怎么回事输入入命令 node
require('express')
报错信息为
D:\Program Files\nodeJs\node_global\express:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
- 如图:

- 安装cnpm
输入npm install -g cnpm --registry=https://registry.npm.taobao.org
- 如下图:

- 输入cnpm -v

- 即安装成功
分割线
相关信息
以上就是我关于 ES6快速入门 知识点的整理与总结的全部内容,希望对你有帮助。。。。。。。
Powered by Waline v2.15.4