Babies with zero foundation, follow the video to learn Angular, and will teach you how to create a new project.
However, when operating, you will encounter problems that cannot be created.
Next, let's take a look at the problem of getting stuck at the door of my house when Angular started.
In the case that nodejs has been installed, it is recommended to use the cnpm command to install Angular CLI globally
cnpm install -g @angular/cli
It goes like this
Check Angular version
cnpm install -g @angular/cli
It seems that there is no problem.
Let’s continue.
Now let’s use the command to create an Angular local running project, choose the content you want to configure,
ng new my-project-name
is configured, and then ENTER to load the project, but you will find that
setTimeout is not defined and an error will be reported.
No matter how you change the configuration options, an error will be reported!
Here is the answer, don't want to read and continue to pay
attention! The reason for the error is that the cnpm installation was used. Therefore, you need to uninstall Angular and download it with npm again before you can use it.
uninstall angular/cli
npm uninstall -g @angular/cli Uninstall scaffolding
npm install -g @angular/cli install scaffolding
ng new my-project Create angular project
Done!
cd my-project to open the project file
To be continued...