Detailed Ubuntu installed the pit encountered by Angular-CLI

Ubuntu16.04

According to the requirements of the official document, follow the installation of

Angular-CLI , but we know that the environment is sometimes It is easy to configure, sometimes it will be angry, and different operating systems, the problems that appear are not the same. I installed it today, stepped on a few pits, and shared it here.

NodeJS, NPM

According to the official tutorial requirements:

Verify That You are running at Least Node.js Version 8.x or greater And NPM Version 5.x or greater by running node -v and npm -v in a Terminal / console window. Older Versions Product Errors, But Nei Versions Are Fine.
So to upgrade

node and NPM version.

Sudo npm cache clean -fsudo npm install -g nsudo n stablesudo npm install -g npm
   
Here us Use N
to help update

Node . If the above process is too slow, we must update the source of npm

:

Sudo NPM Config Set Registry HTTPS: //registry.npm.taobao.org
   Can be replaced here because the back is installed 
Angular-CLI or the source is required.

Note: The above step must be installed using

SUDO

, because when

n
is used, the creation of the file is required, It is still very troublesome after the configuration of the permissions will be made. Installing Angular-CLI
The above is mentioned above, and must change the domestic source when installing, and then install.

Sudo npm install -g @ Angular / CLI

After this installation, it is probably like this:
 The two lines of the last side are most important. Then follow the tutorial, look at the version:   This is because there is no command in the system command, all the people can't use 
ng The command.

Sudo ln -S / OPT / Node / bin / ng / usr / local / bin / ng 详解Ubuntu安装angular-cli遇到的坑

Then you can use it: 详解Ubuntu安装angular-cli遇到的坑

It is installed here, and the latter preliminary construction Angular

small project is more smooth, here is not Let mear out.
Official document: https://angular.io/guide/quickstart
  The above is all of this article, I hope to help everyone, I hope everyone will support Tumi Cloud.  
© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment