Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warn uninstall not installed for npm

Tags:

node.js

npm

I downloaded and installed nodejs on Windows. I'm trying to uninstall the version of typescript I have to get to an older version. When I run

npm uninstall typescript 

or

npm uninstall -g typescript

I get

npm warn uninstall not installed in C:\Program Files\nodejs\node_modules: "[email protected]"

How can I uninstall typescript without having npm uninstall work? Thanks in advance.

like image 915
Crystal Avatar asked Nov 24 '22 01:11

Crystal


1 Answers

You should have been able to uninstall typescript with the command

npm rm typescript
npm rm -g typescript

which is equivalent to uninstall. If that doesn't work, it is safe to find the typescript directory in Windows Explorer under C:\Program Files\nodejs\node_modules and remove it.

This should get you to a state with no typescript installed:

npm ls typescript
npm ls -g typescript

both show (empty).

Second point: npm view typescript version is not showing you information about your local setup, but rather the state of the npm repository, so it will always show you the version that corresponds to typescript@latest. At the time you asked this question, it was 0.9.7; it is now 1.3.0

Finally: to install a specific version of typescript such as 0.9.5, do

npm install -g [email protected]

Also, in general, you should make sure you have the latest node and npm. Updating npm on windows is a little tricky; you should follow the guide here: https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

like image 79
Sam Mikes Avatar answered Nov 25 '22 16:11

Sam Mikes