Angular-cli: Error: Cannot find module 'ng-factory'

Created on 16 Nov 2016  路  4Comments  路  Source: angular/angular-cli

Hi,
I am using Windows 10, node 6.9.1 and [email protected]

I simply install ng-cli

npm install ng-cli -g

And then I went to a project which is created by ng-cli and ran:

ng serve

I get the following error.

C:\Users\ali\AppData\Roaming\nvm\v6.9.1\node_modules\ng-cli\node_modules\resolve\lib\sync.js:33
throw new Error("Cannot find module '" + x + "' from '" + y + "'");
^

Error: Cannot find module 'ng-factory' from 'C:\Users\ali\projects\sensorfront-consultancy-homepage'
at Function.module.exports [as sync] (C:\Users\ali\AppData\Roaming\nvm\v6.9.1\node_modules\ng-cli\node_modules\resolve\lib\sync.js:33:11)
at module.exports (C:\Users\ali\AppData\Roaming\nvm\v6.9.1\node_modules\ng-cli\node_modules\resolve-require\lib\index.js:10:24)
at Command. (C:\Users\ali\AppData\Roaming\nvm\v6.9.1\node_modules\ng-cli\lib\index.js:49:5)
at Command.listener (C:\Users\ali\AppData\Roaming\nvm\v6.9.1\node_modules\ng-cli\node_modules\commander\index.js:301:8)
at emitTwo (events.js:106:13)
at Command.emit (events.js:191:7)
at Command.parseArgs (C:\Users\ali\AppData\Roaming\nvm\v6.9.1\node_modules\ng-cli\node_modules\commander\index.js:615:12)
at Command.parse (C:\Users\ali\AppData\Roaming\nvm\v6.9.1\node_modules\ng-cli\node_modules\commander\index.js:458:21)
at Object. (C:\Users\ali\AppData\Roaming\nvm\v6.9.1\node_modules\ng-cli\lib\index.js:55:9)
at Module._compile (module.js:570:32)

I then create a new folder and tried ng init and I get the following error:

sh: 1: yo: not found

Thank you for your help,
Ali

FYI - ng --version returns undefined

Most helpful comment

I should have angular-cli instead of ng-cli

All 4 comments

I should have angular-cli instead of ng-cli

Now it is @angular/cli

Thanks @jdelafon, this worked for me.

npm i -g @angular/cli

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericel picture ericel  路  3Comments

delasteve picture delasteve  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments