is there a way to fix iconv-lite error when create-react-app

616 views Asked by At

I'm trying to create react app so use "npx create-react-app myprojectname" but it keeps causing error "cannot find module 'iconv-lite'. i tried "npx --ignore-existing create-react-app myprojectname" and install icov-lite but still same error. and of course i checked the version of node and npm, it's enough for requirements and also installed npx too. Please help.

1

There are 1 answers

0
Steveloper On

solved this problem. the problem was yarn, probably. when i'm having this error, i don't really remember much but some words with yarn were appeared on console which i didn't pay attention to it because clearly it says error: cannot find module. however when i tried "create-react-app" at home, it worked and my computer haven't installed yarn so no words related to yarn didn't appear. so i kind of doubt about yarn so deleted executing "npm uninstall -g yarn" and tried "npx create-react-app", it worked! happy now :)