Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module '@angular/forms'

I'm developing an Ionic 2/Angular app and I'm trying to use form validation following this tutorial: https://angular.io/docs/ts/latest/cookbook/dynamic-form.html

But the compiler says:

Cannot find module '@angular/forms'.

Why is this modules not available? Is it deprecated?

like image 890
Natanael Avatar asked Dec 10 '22 15:12

Natanael


2 Answers

I ran into the same problem, my solution was:

1) add forms to the package.json:

"dependencies": {
...
"@angular/forms":   "0.2.0",
...
}

2) install using npm in the console, type within the app folder

npm install

3) run app again

npm start

Hope this helps

like image 151
Björn Kechel Avatar answered Feb 11 '23 03:02

Björn Kechel


Try npm install @angular/forms --save

It will warn you that you should be using 2.0.0-rc.4 though. This may come with it's own set of upgrade challenges...

like image 29
Russ Avatar answered Feb 11 '23 02:02

Russ