I just downloaded node but npm is not working. whenever I use a npm comman I get Error: cannot find module \'strip-ansi\'.
I hit this same issue. I tried to update npm after a fresh Node.js install, but cancelled in the middle because it appeared stuck. Reinstalling Node.js didn't help.
I resolved the issue by deleting the temporary npm
files in my AppData
folder (for me on Windows, I found it in c:\Users\Me\AppData\Roaming\npm
). Then I was able to run npm
normally again.
Hope that helps!
I was stuck on this problem too. Finally, I solved the issue by adding value '.js', '.ts'
to resolve.extensions
in my webpack.config.js
. If you are using webpack too, this may help.
I had the same issue with my next js application. What i did was uninstall strip-ansi(npm uninstall strip-ansi) and then reinstall (npm install strip-ansi)
Clear your temporary paths of npm and this is solution. if you're using linux:
go to $ cd /tmp/
search by npm-* folders
and remove all.
It solved for me by going to the NPM install folder at /usr/local/lib/node_modules/npm
and running the yarn
command. After running it successfully, NPM started working normally.
just reinstall strip using npm install strip --save
this kind of error occurs because some file may be corrupt in strip library if this will not work you can try also npm install
you will solve this error.