简体   繁体   中英

Angular 2 Cli: ng serve error

I have created new Angular 2 application with angular-cli like this: ng new PROJECT_NAME But when I run ng serve , it displays this error:

Error: Attempting to watch missing directory: typings ...

broccoli plugin was instantiated at: ....

You should install typings package: npm install typings --global

and than run following command:

npm run postinstall

Postinstall is a process that needs to take place after npm installs all the required packages through. On some systems it does not take place. To force it to install run the following commands in the project directory:

npm i -g typings

npm run postinstall

After running these you can easily launch ng serve in the project directory

proxy issue maybe use create a file in your root folde

{
    proxy=http://ip-addres:port
    "rejectUnauthorized": false
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM