If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.
yes
create-react-app demo
cd demo
npm start
will get the following error message:
Failed to compile.
Error in ./src/index.js
Module build failed: Error: Cannot find module 'electron-to-chromium' (While processing preset: "/mnt/c/Users/kunch/github/demo/node_modules/babel-preset-env/lib/index.js") (While processing preset: "/mnt/c/Users/kunch/github/demo/node_modules/babel-preset-react-app/index.js")
@ multi main
I looked into node_modules/electron-to-chromium and there's no index.js in it, which might be the cause. however i'm curious why a clean setup of create-react-app would run into this problem.
Expecting "npm start" to start the dev server.
get the following error message:
Failed to compile.
Error in ./src/index.js
Module build failed: Error: Cannot find module 'electron-to-chromium' (While processing preset: "/mnt/c/Users/kunch/github/demo/node_modules/babel-preset-env/lib/index.js") (While processing preset: "/mnt/c/Users/kunch/github/demo/node_modules/babel-preset-react-app/index.js")
@ multi main
kunchenguid@DESKTOP-284F0JO /m/c/U/k/g/demo> npm ls react-scripts
[email protected] /mnt/c/Users/kunch/github/demo
└── [email protected]
kunchenguid@DESKTOP-284F0JO /m/c/U/k/g/demo> node -v
v7.8.0
kunchenguid@DESKTOP-284F0JO /m/c/U/k/g/demo> npm -v
4.4.4
consistently reproducible with clean new project.
create-react-app demo
cd demo
npm start
Try running
cd demo
rm -rf node_modules
npm cache clear
npm install
I can’t reproduce this with given Node and npm versions so it’s likely a corrupted cache, a bad local registry, or something like this.
Unfortunately we can’t do anything about npm bugs, but you can try using Yarn instead:
npm i -g yarn
Then next time you run CRA, it will use Yarn and hopefully won’t fail.
Most helpful comment
Try running
I can’t reproduce this with given Node and npm versions so it’s likely a corrupted cache, a bad local registry, or something like this.
Unfortunately we can’t do anything about npm bugs, but you can try using Yarn instead:
Then next time you run CRA, it will use Yarn and hopefully won’t fail.