Search code examples
reactjsreactjs-fluxtodomvc

React TodoMVC turorial react-boilerplate cant get to running


I ran into problem when i want to setup project of react-boilerplate from tutorial: http://facebook.github.io/flux/docs/todo-list.html#content

When i run npm install it install all modules, but when i use command npm run build as tutorial says i get this kind of error:

C:\Users\Andraz\Desktop\react-boilerplate>npm run build

> [email protected] build C:\Users\Andraz\Desktop\react-boilerplate
> browserify . -t [envify --NODE_ENV production] | uglifyjs -cm > js/bundle.min.js

The system cannot find the path specified.
Error: Cannot find module 'C:\Users\Andraz\Desktop\react-boilerplate' from 'C:\Users\Andraz\Desktop\react-boilerplate'
at C:\Users\Andraz\Desktop\react-boilerplate\node_modules\browserify\node_modules\browser-resolve\node_modules\resolve\lib\async.js:55:21
at load (C:\Users\Andraz\Desktop\react-boilerplate\node_modules\browserify\node_modules\browser-resolve\node_modules\resolve\lib\async.js:69:43)
at onex (C:\Users\Andraz\Desktop\react-boilerplate\node_modules\browserify\node_modules\browser-resolve\node_modules\resolve\lib\async.js:92:31)
at C:\Users\Andraz\Desktop\react-boilerplate\node_modules\browserify\node_modules\browser-resolve\node_modules\resolve\lib\async.js:22:47
at FSReqWrap.oncomplete (fs.js:95:15)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v0.12.3
npm ERR! npm  v2.9.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `browserify . -t [envify --NODE_ENV  production] | uglifyjs -cm > js/bundle.min.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'browserify . -t [envify --NODE_ENV production] | uglifyjs -cm > js/bundle.min.js'.
npm ERR! This is most likely a problem with the todomvc-flux package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     browserify . -t [envify --NODE_ENV production] | uglifyjs -cm > js/bundle.min.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls todomvc-flux
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Andraz\Desktop\react-boilerplate\npm-debug.log

I use Win7. What could i be doing wrong?


Solution

  • I encountered this same issue.

    You likely copied the package.json from the github repo as the tutorial directs.

    If you examine the package.json tasks, you'll see that it references bundle.js and app.js both in the js/ directory.

    Create this directory in the root project (same directory as package.json) and non run build will now complete.

    The tutorial makes it sound as if it will describe all steps you need to make when starting with react-bootstrap but it does not. It's more of a broad strokes summary.