Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find Typescript using NVM

I have nvm installed and recently fixed an issue with a conflict with a previously installed version of node. Fixing it meant removing the node executable from the prior location. Some things still work but I'm getting this error: Cannot find module 'typescript'

and this fix didn't help me: How to fix Cannot find module 'typescript' in Angular 4?

running ng new is what is triggering the error.

I have typescript installed globally. And to ensure that is installed with this version of node, I ran:

nvm use 10 && npm i -g typescript
/Users/username/.nvm/versions/node/v10.16.0/lib/node_modules/typescript/bin/tsserver

Thanks, Wayne

like image 423
Wayne F. Kaskie Avatar asked Sep 06 '25 16:09

Wayne F. Kaskie


1 Answers

Hopefully this will help folks ...

You can use mv, to install Typescript; this seems good for me, but I don't go our of my way to use Typescript.

$ nvm  --version
$ nvm  use stable
$ npm  install typescript --save-dev
$ npx  tsc --version
Version 5.0.4
$ 

what seems to work is fine for me :-)

See also:

  • Typescript download
like image 194
will Avatar answered Sep 09 '25 00:09

will