Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Environment Building and frequently asked questions for the latest version of angular2.0

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Step 1: install Node.js,npm (npm is automatically installed when you install Node.js)

Part 2: install npm. Because the npm official website image access is too slow, we use the npm image of Taobao in the node command window (windows's cmd, linux's terminal) $npm install-g cnpm-- registry= https://registry.npm.taobao.org

Part III: set Taobao image, temporarily switch npm source to taobao source (faster): npm config set registry https://registry.npm.taobao.org

Part IV: install @ angular/cli scaffolding, $npm install-- save-dev @ angular/cli@latest

Be sure to uninstall clean 1:npm uninstall-g @ angular/cli,2:npm cache clean if the previous installation failed

Fifth: test, enter ng-v, there is version information indicating that the installation is successful

Sixth: create an Angular2 project, create a new folder (young), and then enter the ng new project name (ngtest) on the command line.

This process may wait for a while (it may take a long time, but you must be patient) until the prompt on the last line of the following figure indicates that the framework for the entire project has been built.

When we open the project with webstrom, we can see that the framework contains a lot of content, which is also the advantage of using AngularJS cli. One sentence of code, all the environments of the whole project, have been set up for you.

Seventh: start the project, enter the project directory (ngtest) of the newly created angular2, and show success as shown in the arrow in the figure

Eighth: do not close the command window, open the web page, type: http://localhost:4200/, appear as shown in the picture, finally done

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report