how to un-init NPM?

Viewed 6666

So oddly I really cannot find the answer to this question and after a few posts and docs I've looked at on NPM I've decided to ask the question - which may be a very basic one but doesn't seem to be implicitly addressed...

How do you uninstall npm from a dir?

Premis:

you npm init -y on the wrong directory

desired outcome:

to remove npm from that directory

I'm working on windows 10 / using git bash on VS code terminal

any help here would be appreciated -

Wally

2 Answers

All npm init does is setting up package.json for you (guided or not). If you just del package.json from the wrong directory, you should be good to go.

Deleting the package.json from the wrong directory should do the trick.

You will have to keep in mind that if in case you have run the npm i or npm install commands after npm init you will also have to delete the node_modules folder (as it usually takes plenty of disk space) and run npm i now in the correct directory.

Related