Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I have a new project, but when execute ng serve, I get error

I need to change this topic, I cant post new topic. I have update the script, and install new package. I still get errors but not the one I post last.

                             _                           _  _
  __ _  _ __    __ _  _   _ | |  __ _  _ __         ___ | |(_)
 / _` || '_ \  / _` || | | || | / _` || '__|_____  / __|| || |
| (_| || | | || (_| || |_| || || (_| || |  |_____|| (__ | || |
 \__,_||_| |_| \__, | \__,_||_| \__,_||_|          \___||_||_|
               |___/
angular-cli: 1.0.0-beta.26
node: 8.12.0
os: linux x64
@angular/animations: 6.1.9
@angular/cdk: 6.4.7
@angular/common: 6.1.9
@angular/compiler: 6.1.9
@angular/core: 6.1.9
@angular/forms: 6.1.9
@angular/http: 6.1.9
@angular/material: 2.0.0-beta.10
@angular/platform-browser: 6.1.9
@angular/platform-browser-dynamic: 6.1.9
@angular/platform-server: 6.1.9
@angular/router: 6.1.9
@angular/compiler-cli: 6.1.9
@ngtools/webpack: 1.10.2

I get this errors now. and this is new error that i dont now how to fix.

WARNING in ./~/ng2-webstorage/dist/app.js
11:35-46 "export 'OpaqueToken' was not found in '@angular/core'

WARNING in ./~/@angular/material/@angular/material.es5.js
6128:45-70 "export 'ConnectedOverlayDirective' was not found in '@angular/cdk/overlay'

WARNING in ./~/@angular/material/@angular/material.es5.js
13725:44-56 "export 'OverlayState' was not found in '@angular/cdk/overlay'

WARNING in ./~/@angular/material/@angular/material.es5.js
15765:42-54 "export 'OverlayState' was not found in '@angular/cdk/overlay'

WARNING in ./~/@angular/material/@angular/material.es5.js
16831:48-60 "export 'OverlayState' was not found in '@angular/cdk/overlay'

WARNING in ./~/@angular/material/@angular/material.es5.js
17553:48-60 "export 'OverlayState' was not found in '@angular/cdk/overlay'

WARNING in ./~/@angular/material/@angular/material.es5.js
18421:48-60 "export 'OverlayState' was not found in '@angular/cdk/overlay'

WARNING in ./~/@angular/material/@angular/material.es5.js
19726:48-60 "export 'OverlayState' was not found in '@angular/cdk/overlay'

WARNING in ./~/angular2-semantic-ui/components/dropdown/dropdown.ts
139:16-23 "export 'trigger' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/dropdown/dropdown.ts
140:20-25 "export 'state' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/dropdown/dropdown.ts
140:38-43 "export 'style' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/dropdown/dropdown.ts
144:20-25 "export 'state' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/dropdown/dropdown.ts
144:36-41 "export 'style' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/dropdown/dropdown.ts
148:20-30 "export 'transition' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/dropdown/dropdown.ts
148:54-61 "export 'animate' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
53:16-23 "export 'trigger' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
54:20-25 "export 'state' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
54:38-43 "export 'style' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
59:20-25 "export 'state' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
59:36-41 "export 'style' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
64:20-30 "export 'transition' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
64:53-60 "export 'animate' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
65:20-30 "export 'transition' was not found in '@angular/core'

WARNING in ./~/angular2-semantic-ui/components/accordion/accordion_panel.ts
65:53-60 "export 'animate' was not found in '@angular/core'

And I can't find answer to this errors. I hope, I can find an answer now, so I can keep on with this script.

like image 978
Niklas Avatar asked Oct 02 '18 12:10

Niklas


People also ask

How do I fix ng serve not working?

To solve the error "ng: command not found", install the angular cli package globally by running npm install -g @angular/cli@latest and restart your terminal. If the command fails, run it with sudo and make sure the correct PATH is set in your system's environment variable.

How fix the serve command requires to be run in an Angular project but a project definition could not be found?

This error often occurs when a project you are running is not an Angular project. It may also be the case when you download an Angular project but do not have latest dependencies installed on your machine. Installing latest dependencies should fix the problem.

How do you solve no projects support the serve target?

First, you need to make sure that the angular cli is installed. Open cmd and type ng –version. You will get the following result in the cmd window. > Windows Start > Settings > Search for Advanced System settings.

What happens when Ng serve command is executed?

ng serve command builds and serve the application. It rebuilds the application if changes occur. Here project is the name of the application as defined in angular.


2 Answers

I would recommend reading this:

https://www.techiediaries.com/updating-angular-cli-projects/

On this page it states:

Angular 6 uses angular.json instead of angular-cli.json. This can be achieved using :

ng update @angular/cli

This solved my issue.

Good luck

like image 198
Maniac_1979 Avatar answered Oct 05 '22 11:10

Maniac_1979


Angular 6 looks for angular.json instead of angular-cli.json.

You need to update your @angular/cli. Adding to the above answer

I did update all the package with the following commands and updated all dependencies too. So as to remove all compatibility issues with other packages.

If you are starting your app or demo app, follow this procedure. Be extra careful if you are doing this for production app.

npm install -g npm-check-updates
ncu -u
ng update @angular/cli
npm install

Install npm-check-updates

npm install -g npm-check-updates 

Use ncu to update your package.json

ncu for display

ncu -u for re-writing your package.json

Update your @angular/cli to modify your application to be compatible with angular 6

ng update @angular/cli 

enter image description here

and run npm install to update your packages

like image 45
Karthikeyan VK Avatar answered Oct 05 '22 12:10

Karthikeyan VK