1.官网下砸安装node 2.运行cmd,输入命令node -v ,检测node安装成功后,输入命令npm install -g @angular/cli 3.运行cmd,输入名利ng -v ,检测angular安装成功后,输入命令npm install 4.运行cmd进入到项目文件夹目录最外层,输入命令npm serve 5.打开浏览器输入地址:http://localhost:4200 6.看到你想看到的页面就成功
ng build --prod 首页中要该base 为/nuoxiao/ 将httpService 中的公用nuoxiao去掉 ng build --prod --base-href /nuoxiao/
解决办法一: 修改目录: my-project/node_modules/.bin 找到 ng.cmd 修改max_old_space_size: @IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" --max_old_space_size=8192 "%~dp0...@angular_cli@1.0.0@@angular\cli\bin\ng" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node --max_old_space_size=2048 "%~dp0...@angular_cli@1.0.0@@angular\cli\bin\ng" %* ) 修改目录: my-project/node_modules/.bin 找到 ngc.cmd 修改max_old_space_size: @IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" --max_old_space_size=8192 "%~dp0...@angular_compiler-cli@4.0.1@@angular\compiler-cli\src\main.js" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node --max_old_space_size=2048 "%~dp0...@angular_compiler-cli@4.0.1@@angular\compiler-cli\src\main.js" %* ) 解决办法二: 1、全局安装increase-memory-limit,命令如下: npm install -g increase-memory-limit
2、进入项目目录,执行下列命令: increase-memory-limit
This project was generated with Angular CLI version 1.5.0.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the -prod
flag for a production build.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.