Installation and Configuration Node.js + angular mounting

A mounting node.js Step
1, download node.Js
download the corresponding version of your system Node.js: HTTPS: //nodejs.org/en/download/
Here Insert Picture Description
2, after the download is complete, double-click "node-v6.9.2-x64 .msi ", to start the installation
Here Insert Picture Description
click" next "
Here Insert Picture Description
check box, click next
Here Insert Picture Description
revised destination folder, click next
Here Insert Picture Description
Here Insert Picture Description
to complete the installation even h click Finish
Here Insert Picture Description
2, environment configuration
environment configuration where the main configuration of global module is installed npm where path, and the path of the cache buffer, the reason for the configuration, because after performing similar: npm install express [-g] (-g behind optional parameters, representative of the overall installation g global mean) statement is mounted, will be the installation of the module to [C: \ users \ username \ AppData \ Roaming \ npm] path, accounting for C disk space.
For example: I want the whole module resides on my path and cache path node.js installation folder, the files in the folder I installed [D: \ Develop \ nodejs create two folders] under [] and [node_global node_cache] FIG follows:

Here Insert Picture Description
After you've created two empty folder, open the cmd command window, type

npm config set prefix “D:\Develop\nodejs\node_global”
npm config set cache “D:\Develop\nodejs\node_cache”
Here Insert Picture Description
接下来设置环境变量,关闭cmd窗口,“我的电脑”-右键-“属性”-“高级系统设置”-“高级”-“环境变量”
Here Insert Picture Description
进入环境变量对话框,在【系统变量】下新建【NODE_PATH】,输入【D:\Develop\nodejs\node_global\node_modules】,将【用户变量】下的【Path】修改为【D:\Develop\nodejs\node_global】
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
至此Node.js已经安装配置完成,可以先进行下简单的测试是否成功了,后面还要进行环境配置
在键盘按下【win+R】键,输入cmd,然后回车,打开cmd窗口
Here Insert Picture Description
Here Insert Picture Description
安装完后的目录如下图所示:
Here Insert Picture Description
二、Angular安装
1、先安装上面的nodejs
2、安装cnpm
在cmd命令窗口中直接输入:
Npm install cnpm --registry=https://registry.npm.taobao.org -g
按下enter键,如下所示:
Here Insert Picture Description
Here Insert Picture Description
3、安装脚手架
在cmd中输入命令: npm install -g @angular/cli
安装完成后输入:ng v 查看:
Here Insert Picture Description
创建项目:ng new 项目名称

出现的问题与解决方案:
Here Insert Picture Description
此问题只需将自己的cnpm的安装路径添加到自己的系统变量的path下即可解决。

Released three original articles · won praise 1 · views 83

Guess you like

Origin blog.csdn.net/weixin_45158228/article/details/104518874