Can not start the app! Module not found: Error: Cannot resolve module!
I am trying to follow the instruction to getting start. When I try to run npm start, i have got following few errors:
ERROR in ./~/@angular2-material/checkbox/checkbox.umd.js
Module not found: Error: Cannot resolve module '@angular/forms' in ~\angular2-shop\node_modules\@angular2-material\checkbox
@ ./~/@angular2-material/checkbox/checkbox.umd.js 2:110-135
ERROR in ./~/ng2-select/bundles/ng2-select.umd.js
Module not found: Error: Cannot resolve module '@angular/forms' in ~\angular2-shop\node_modules\ng2-select\bundles
@ ./~/ng2-select/bundles/ng2-select.umd.js 3:81-106
Child html-webpack-plugin for "index.html":
chunk {0} index.html 1.63 kB [rendered]
[0] ./~/html-webpack-plugin/lib/loader.js!./client/index.html 1.63 kB {0} [built]
factory:282ms building:46ms = 328ms
webpack: Failed to compile.
[default] Checking started in a sepa0265ms o0ms optimize assets
Hash: 23e8d2ac06303e53964f
Version: webpack 1.15.0
Time: 28223ms
+ 823 hidden modules
ERROR in ./~/@angular2-material/checkbox/checkbox.umd.js
Module not found: Error: Cannot resolve module '@angular/forms' in ~\angular2-shop\node_modules\@angular2-material\checkbox
resolve module @angular/forms in ~\angular2-shop\node_modules\@angular2-material\checkbox
looking for modules in ~\angular2-shop\client
~\angular2-shop\client\@angular doesn't exist (module as directory)
looking for modules in ~\angular2-shop\node_modules
resolve 'file' or 'directory' forms in ~\angular2-shop\node_modules\@angular
resolve file
~\angular2-shop\node_modules\@angular\forms doesn't exist
~\angular2-shop\node_modules\@angular\forms.ts doesn't exist
~\angular2-shop\node_modules\@angular\forms.js doesn't exist
~\angular2-shop\node_modules\@angular\forms.scss doesn't exist
resolve directory
~\angular2-shop\node_modules\@angular\forms doesn't exist (directory default file)
~\angular2-shop\node_modules\@angular\forms\package.json doesn't exist (directory description file)
[~\angular2-shop\client\@angular]
[~\angular2-shop\node_modules\@angular\forms]
[~\angular2-shop\node_modules\@angular\forms.ts]
[~\angular2-shop\node_modules\@angular\forms.js]
[~\angular2-shop\node_modules\@angular\forms.scss]
@ ./~/@angular2-material/checkbox/checkbox.umd.js 2:110-135
ERROR in ./~/ng2-select/bundles/ng2-select.umd.js
Module not found: Error: Cannot resolve module '@angular/forms' in ~\angular2-shop\node_modules\ng2-select\bundles
resolve module @angular/forms in ~\angular2-shop\node_modules\ng2-select\bundles
looking for modules in ~\angular2-shop\client
~\angular2-shop\client\@angular doesn't exist (module as directory)
looking for modules in ~\angular2-shop\node_modules
resolve 'file' or 'directory' forms in ~\angular2-shop\node_modules\@angular
resolve file
~\angular2-shop\node_modules\@angular\forms doesn't exist
~\angular2-shop\node_modules\@angular\forms.ts doesn't exist
~\angular2-shop\node_modules\@angular\forms.js doesn't exist
~\angular2-shop\node_modules\@angular\forms.scss doesn't exist
resolve directory
~\angular2-shop\node_modules\@angular\forms\package.json doesn't exist (directory description file)
~\angular2-shop\node_modules\@angular\forms doesn't exist (directory default file)
[~\angular2-shop\client\@angular]
[~\angular2-shop\node_modules\@angular\forms]
[~\angular2-shop\node_modules\@angular\forms.ts]
[~\angular2-shop\node_modules\@angular\forms.js]
[~\angular2-shop\node_modules\@angular\forms.scss]
@ ./~/ng2-select/bundles/ng2-select.umd.js 3:81-106
and the process stack by given a error as following:
[default] ~/angular2-shop/node_modules/rxjs/scheduler/Action.d.ts:30:1
Declaration or statement expected.
@angular2-material/checkbox package is no longer been used since September of 2016. I found following message when i was trying to browse the material checkbox package in NPM site:
This package was used early in the pre-release development cycle of Angular Material v2, but has no longer been used since September of 2016. Development of Angular Material now occurs under scoped npm package @angular/material. Visit https://material.angular.io for the latest information and instructions for using Angular Material or check out the latest source code from https://github.com/angular/material2.
Already i have run following command but still not fixed:
npm install --save @angular/material
That’s because your code still references the old package. If I get bored, I might fork this and update to latest angular and dependencies
do it man ;)
I have the same problem who knows how to solve it