I am trying to set up angular project from scratch.
Below are the steps followed
Installed Node js
Installed Angular CLI using npm install -g #angular/cli#latest
Versions
Angular CLI: 9.1.4
Node: 12.16.3
OS: win32 x64
Angular:
...
Ivy Workspace:
Package Version
#angular-devkit/architect 0.901.4
#angular-devkit/core 9.1.4
#angular-devkit/schematics 9.1.4
#schematics/angular 9.1.4
#schematics/update 0.901.4
rxjs 6.5.4
Created a new app using ng new app_name
While trying to run the app through command ng serve I am getting a host of errors and app is not starting up
Have attached screen shot of the error
edit
If you use angular 9.1.6 it should be fine now
npm update #angular/cli #angular/core
original post
I had the same problem after making a fresh project using
npm install -g #angular/cli
ng new <projectname>
I believe its a bug in 9.1.5 Angular when using the 9.1.4 cli
You'll see the issue when you do
ng --version
if you get:
Angular CLI: 9.1.4
Node: 12.16.3
OS: win32 x64
Angular: 9.1.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
To resolve you install 9.1.4 Angular instead by running after you've done your
ng new <projectname>
then run
npm install #angular/core#9.1.4 #angular/animations#9.1.4 #angular/common#9.1.4 #angular/forms#9.1.4 #angular/platform-browser#9.1.4 #angular/router#9.1.4 #angular/platform-browser-dynamic#9.1.4 #angular/compiler#9.1.4 #angular/compiler-cli#9.1.4 #angular/language-service#9.1.4
ng build
See my other answer for reference
ERROR in TypeError: Cannot read property 'flags' of undefined
Related
I have downloaded nodejs (v14.16.0) on my pc and I tried to install angular using this command: npm install -g #angular/cli
But when I try to check the version of the angular using command ng version it is showing me this error:
I started a project back in August, I was able to create components just fine. But, now when I try to generate an Angular component I receive this error
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Cannot read property 'kind' of undefined
I'm using Angular 10 and NativeScript 7
Angular CLI: 10.1.7
Node: 10.22.0
OS: darwin x64
Angular: 10.1.6
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
#angular-devkit/architect 0.1001.7
#angular-devkit/build-angular 0.1001.7
#angular-devkit/core 10.1.7
#angular-devkit/schematics 10.1.7
#angular/cdk 10.2.5
#angular/cli 10.1.7
#angular/material 10.2.5
#schematics/angular 10.1.7
#schematics/update 0.1001.7
rxjs 6.6.3
typescript 3.9.7
I want to publish my angular application for production, when i run
ng build --prod --aot = false
it builds successfully, but the main.js file is large(6 MB), same with vendor.js (10 mb), which make my application so slow. So i tried running with ng build --prod, but i get this error
ERROR in : Error: Internal error: unknown identifier [{"filePath":"C:/Users/myuser/Documents/anular-app/angularpp_test/Client/myweb/node_modules/#angular/core/core.d.ts","name":"ErrorHandler","members":[]}]
this is my configuration
Angular CLI: 6.0.7
Node: 8.9.4
OS: win32 x64
Angular: 5.2.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
#angular-devkit/architect 0.6.7
#angular-devkit/build-angular 0.6.7
#angular-devkit/build-optimizer 0.6.7
#angular-devkit/core 0.3.1
#angular-devkit/schematics 0.6.7
#angular/cli 6.0.7
#angular/flex-layout 2.0.0-beta.10
#ngtools/webpack 6.0.7
#schematics/angular 0.6.7
#schematics/update 0.6.7
rxjs 5.5.2
typescript 2.4.2
webpack 4.8.3
Look in your app.modules, specifically where your provider. Must be using a
provide: [ErroHandler]
Remove this brackets.
I've just updated the angular-cli
If I check the terminal with ng -v this is what i get:
Angular CLI: 1.6.1
Node: 8.6.0
OS: darwin x64
Angular:
...
When I try to scaffold a new angular application with the following command
ng new my-app
I get the following error message:
Error: obs.pipe is not a function
obs.pipe is not a function
I've tried to install and uninstall the cli several times but still I can't solve the issue.
I had the exact same error when using the following command
ng g module <module-name>
Turns out my problem was a mismatch between the global angular cli version and the local one. Running
npm install -save-dev #angular/cli#latest
solved it for me. (I ran it in the parent directory to the project I was using, but it should work in the same directory also).
I am trying to generate a new project and skeleton application using the latest version of Angular. I have tried uninstalling and reinstalling Angular CLI using:
C:\>npm install -g #angular/cli#latest
C:\>ng --version
#angular/cli: 1.4.5
node: 8.8.1
os: win32 x64
This error occurs when trying to run 'ng new my-app' in command prompt:
'Error: The command "new" has an option without the required type and name field'
Any help to resolve this issue is appreciated.
This is a known issue and there is an issue raised in github for this.
https://github.com/angular/angular-cli/issues/7984
Try below commands:
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
After these steps:
npm uninstall -g #angular/cli
npm cache clean
npm install -g #angular/cli#latest
Do:
npm install #schematics/angular
And then:
ng new appname