I Reinstalled Node.js and Yarn. Now I am getting this error.
My environment information is:
Node: v8.12.0
NPM: 6.4.1
Yarn: 1.10.1
Try this!
npm install -g npm@latest
npm install node
npm install -g yarn
npx create-react-app appname
cd firstapp
yarn start
Once you have cleaned the yarn cache by running:
yarn cache clean
then subsequent calls to:
npx create-react-app your-app
will work.
Best method for windows user is update your yarn If you use npx and got error than update yarn then use npx I have same error in windows 8.1 then I updated yarn and it solved my problem
Npm I yarn@latest
npx creat-react-app app name
Yes, I have the same issue and I am unable to solve but after uninstalling yarn and updating node with the latest version.
Also, make sure you have installed
npm i -g create-react-app
after updating the packages.
Clean the cache also to make it free from bugs this will definitely work
I encountered the same problem. It seems that this occurs when npm
and node
installation is broken. However, sometimes clearing cache doesn't work. I had to not just uninstall but delete/purge all npm
and node
files on my system, and reinstall them back again.
Remove node and npm
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf ~/.npm
sudo apt remove --purge npm
sudo apt remove --purge node
sudo apt remove --purge nodejs
Check if npm and node are removed by running: which node
and which npm
If you still see some folders, try removing them using:
sudo apt-get remove nodejs
sudo apt-get remove npm
Update system, just in case
sudo apt-get update
Install node and npm
sudo apt-get install nodejs
sudo apt-get install npm
Check installation
npm -v
node -v
Note: The steps here involve removing existing modules and putting them back again. I also had to manually uninstall nodejs using Programs and Features (for Windows).
I had same issue and solved it by:
Installing latest version of node, npm and yarn.
npm install -g npm@latest
nvm install node
npm install -g yarn
nvm installs Node.js and npm manages packages.