Reputation: 1393
When I do ng serve I get this result
angular\router\@angular\router.es5.jsError: No module factory available for dependency type: ContextElementDependency
at Compilation.addModuleDependencies
node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:264
if(_this.profile) {
^
TypeError: Cannot read property 'profile' of null
at factoryCallback
angular-cli
"dependencies": { "@angular/animations": "^4.0.1", "@angular/common": "^4.0.0", ...
Upvotes: 0
Views: 918
Reputation: 21
I had the same problem and I solved it by doing the following steps: 1- remove webpack from package.json 2- delete node_modules folder 3- install webpack globally using the following commands: npm install webpack -g npm install webpack-dev-server -g 4- run npm install
Note: If (npm start) generates error try to remove (package-lock.json), delete node_modules, and run "npm install" again
Upvotes: 2
Reputation: 41581
Based on your comment,
In the another machine, install Angular-CLI by using
npm install angular-cli -g
Then try running your app through ng serve
Upvotes: 0
Reputation: 505
As angular 4 is out, use ng new
to generate new angular project as it is mentioned in the change log of angular cli and then try it
https://github.com/angular/angular-cli/blob/master/CHANGELOG.md
or you must update your angular cli https://github.com/angular/angular-cli#updating-angular-cli
Upvotes: 0