I'm new to coding and having issues with why I can no longer get React set up correctly. I struggled last week and then finally managed it. But now I have had the same issue again and nothing is working.
I have a project which I started with npx create-react-app and then when I cd into the project I guess this issue:
解决方法:
In the terminal, run:
cd ~
Then:
ls
You should see a list of files. If node_modules is included in that list (as it appears it should be), you want to delete that folder. You can do so in the terminal like so:
如果你在你的list中看到了,node_modules的话,你要删掉那个文件。在终端中运行下面
rm -rf node_modules
万一,你删错了,请运行rm - rf
But keep in mind: this will not send the folder to the trash. It will irrevocably delete it. rm -rf is a powerful command. If that makes you nervous, type open . instead. That will open your "home" (~) directory in Finder, and you can delete node_modules in the familiar, right-click, send-to-trash way there.
Hope that helps!