Cannot find module @angular\cli\bin\ng

cannot find module '@angular/compiler-cli/ngcc'
cannot find module 'symbol-observable angular/cli
uninstall angular cli
could not find api compiler-cli, function version
angular cli version
appdataroamingnpmng permission denied
update @angular cli
ng serve cannot find module

I'm getting into trouble with anngular-cli installation because it doesn't recognize the ng command in my git bash but it works in my cmd on Windows 7.

I looked for some issues on the web but I didn't really find a solution.

Here, the error :

   ng -v
   module.js:549
    throw err;
    ^

   Error: Cannot find module 'C:\Program 
   Files\Git\node_modules\@angular\cli\bin\ng'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

This error happened the first time I used ng after installing Node and angular-cli globally.

I didn't get this error when I was working on my laptop on Windowsd 10.

Thank you,

Problem:

Error: Cannot find module '..\AppData\Roaming\npm\node_modules\angular-cli\bin\ng' angularJs

Solution:

  1. uninstall angular cli if you have already installed it

    npm uninstall -g @angular/cli
    
  2. Delete the C:\Users\Satish\AppData\Roaming\npm\node_modules@angular folder if it still exists after the uninstall

  3. reinstall angular-cli globally

    npm install -g @angular/cli
    

Can't run any command · Issue #9276 · angular/angular-cli · GitHub, \npm\node_modules@angular\cli\bin\ng npm WARN @angular-devki bug(​schematics): Cannot find module '@angular-devkit/core' #256. Cannot find module '@angular/compiler-cli' when running ng serve #4725. Ib467 commented on Feb 15, 2017. Error: Cannot find module '@angular/compiler-cli' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.require (module.js:498:17) at require (internal/module.js:20:19)

Looks like a dependency was removed somewhere. I worked around this by:

For local angular-cli: npm install @angular-devkit/core --save-dev

For global angular-cli: npm install -g @angular-devkit/core

Edit: As discussed below, you should perhaps not use --save-dev here.

Cannot find module '@angular/compiler-cli' when running ng serve , Cannot find module '@angular/compiler-cli' when running ng serve # argv "/usr​/local/bin/node" "/usr/local/bin/npm" "install" "@angular/cli"  I have an Angular project, I can't run ng serve because it fails with the error:. dev@716a5115c45c:~/project$ npx ng serve Cannot find module '@angular/compiler-cli' Error: Cannot find module '@angular/compiler-cli' at Function.Module._resolveFilename (module.js:548:15) at Function.Module._load (module.js:475:25) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at

The git bash is installed in C:\Program Files\Git where you never find the node_module folder that's why this error occurred

When you hit ng command from CMD it will look node_module folder in C:\Users\uername\AppData\Roaming\npm\ - where npm install global dependency and eventually it finds node_modules folder.

Basically for windows try to run from cmd.

angular/angular-cli, Error: Cannot find module 'C:\Program Files\Git\node_modules\@angular\cli\bin\​ng'. Are the 2 script files at C:\Users\Brad\AppData\Roaming\npm\ng and  @zakir-hussain that should be npm install -g @angular/cli, so you'll probably want to do: npm uninstall -g @angular/cli angular/cli. npm cache clean. npm install -g @angular/cli. If that doesn't fix it, you'll probably want to create a new issue, ensuring to fill out the template provided with reproduction steps.

Error on executing 'ionic serve' on a fresh installation of npm , ng new testapp internal/modules/cjs/loader.js:638 throw err; ^. Error: Cannot find module 'C:\Program Files\Git\node_modules\@angular\cli\bin\ng' (Hmmm !?!). When we run commands like ng serve, it uses the local version of @angular/cli. So first install latest version of @angular/cli locally (without the -g flag). Then update the cli using ng update @angular/cli command. I thing this should fix the issue. Thanks

Git Bash … Angular … ng serve … Cannot find module xxxxx\Git , [ng] internal/modules/cjs/loader.js:800 [ng] throw err; [ng] ^ [ng] Error: Cannot find module 'D:\0. Mayank 2020 - Laptop@angular\cli\bin\ng' Mention any other details that might be useful. I want to use angular CLI inside a docker container using docker-compose. I cannot have the node_modules folder inside the source code and a common pattern to solve this issue is to move the node_modules folder to the parent directory.

Suddenly I cannot serve my app [MODULE NOT FOUND] : ionic, Git Bash … Angular … ng serve … Cannot find module xxxxx\Git\node_modules\​#angular\cli\bin\ng - angular. Versions node -v v8.9.4 npm -v 5.6.0 Repro steps installed new angular cli npm install -g @angular/cli Output C:\Users\xxx\AppData\Roaming pm\ng -> C:\Users\xxx\AppData\Roaming pm ode_modules@angular\cli\bin g npm WARN @angular-devki

Comments
  • Running this npm install -g @angular/cli in root directory (for ex. in c:\) removed this error for me.
  • 2.5 I also had to delete ng.ps1 located in the C:\users\<userid>\AppData\Roaming\npm folder.