When attempting to execute ng build
using Git Bash, I encountered this error message, even though I had previously executed npm install -g typescript.
Where should I place the typescript
installation so that Git can detect it?
Error
$ npm install -g typescript
C:\Users\user\AppData\Roaming\npm\tsc -> C:\Users\user\AppData\Roaming\npm\node_modules\typescript\bin\tsc
C:\Users\user\AppData\Roaming\npm\tsserver -> C:\Users\user\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
+ <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ffbf6ffeafcecfde6fffbcfbca1b8a1bb">[email protected]</a>
updated 1 package in 1.884s
...
$ ng build
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'typescript'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\angular-cli-master\lib\bootstrap-local.js:6:12)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)