Preliminary study on angularjs6.x---environment construction
* Recent projects, just use the ANGULARJS, so just want to tidy up Cheng Bowen, avoid back to forget. First Contact Angularjs was two years ago, when the company used the bootstrap to do the page, Then cooperate with angularjs1.x to do some processing. Later people strongly recommended to use 2.x. Said 2.x than 1.x has a very big change, but has not been empty to the whole, has been put to the present.
Angularjs6.x is still based on Nodejs, so if we want to build a ANGULARJS environment, first we want to install NODEJS, here to emphasize a little, If we want to use angularjs6.x then we have to install the Nodejs version must be greater than or equal to 8.x, and the NPM version must be greater than or equal to 5.x.
Here my operating system is centos7-1804, then the installation command is as follows:
- Add Nodejs address silently and install him into bash: Curl--silent--location https://rpm.nodesource.com/setup_10.x | sudo bash-
- Install Nodejs's compilation environment: Yum Install gcc-c++ make
- Installing nodejs:yum-y Install Nodejs
After installation, run Npm-v as follows
:
Run Node-v as follows:
With these two hints, it means that our Nodejs has been installed successfully, and then we started installing Angularjs/cli:sudo npm install-g @angular/CLI
There may be some installation errors here, at which point we can uninstall and reinstall, and the uninstall command is as follows:
- NPM uninstall-g angular-cli Uninstall the old version npm uninstall @angular/CLI Uninstall the new version
- NPM Cache Clean Cleanup Cache NPM Cache Verify–force Force cleanup cache
In addition, after we install the execution, may appear the same warning, this is because [email protected] is used by the Mac system, if we use the other system will appear such a reminder, so this is normal:
As of here, the environment is not ready to end, in the creation of the project, angularjs6.x also used the git command, if not installed, will be reported that the git command is not found, so we also need to install git. Because I prefer the new software, so I installed the git2.x:
- Yum Install https://centos7.iuscommunity.org/ius-release.rpm
- Yum Install git2u
-
When the environment is ready, we start to create the project and run:
- ng New Conk-out
- CD Conk-out
- Ng Serve–open
After running the effect as shown, see it shows that our environment is ready to complete:
Preliminary study on angularjs6.x---environment construction