dvdzkwsk / react-redux-starter-kit

Get started with React, Redux, and React-Router.
MIT License
10.29k stars 2.2k forks source link

build error : Module build failed: Error: Couldn't find preset "react" relative to directory "/Users/username/tmp" #1255

Open darrenli2 opened 7 years ago

darrenli2 commented 7 years ago

I tried to build the project (npm start)and got this error

ERROR in ./src/main.js
Module build failed: Error: Couldn't find preset "react" relative to directory "/Users/username/tmp"
    at /Users/username/tmp/react-redux-starter-kit/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (native)

Could anyone please help?

matgessel commented 7 years ago

Are you working with a fresh clone of this repository or is this after a git pull? Perhaps your node_modules is borked.

cd /Users/username/tmp/react-redux-starter-kit rm -r node_modules npm install

I just did a fresh clone and it worked for me (macOS 10.12.5, node 7.6.0, npm 4.2.0)

git clone https://github.com/davezuko/react-redux-starter-kit.git cd react-redux-starter-kit npm install npm run start