I just downloaded node but npm is not working. whenever I use a npm comman I get Error: cannot find module 'strip-ansi'.
For what it's worth, this ended up happening to me, using nvm on mac. npm cache clean
didn't work. I ended up reinstalling via nvm:
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
$ nvm install node
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.
npm cache clean
). IMO you should try this first if you're using webpack + typescript –
Jeannettajeannette resolve.modules
were set to [path.resolve(__dirname, 'node_modules')...
where the webpack config file was not in the root. When fixed this with ../node_modules
instead it worked. –
Johnsonjohnsonese 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.
npm install strip-ansi --save
to solve this issue. –
Peltate 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!
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.
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)
I am using yarn in my project and how I fixed this is:
- delete yarn.lock
- delete node_modules
- run yarn in the cmd to reinstall all the node_modules
FYI: everything I tried it didn't work
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.
Solved by doing npm cache clean
and then npm install
© 2022 - 2024 — McMap. All rights reserved.