当我想从教程中设置react-boilerplate项目时,我遇到了问题: http://facebook.github.io/flux/docs/todo-list.html#content
当我运行 npm install 时,它会安装所有模块,但是当我使用命令 npm run build 作为教程说我遇到这种错误:
C:\Users\Andraz\Desktop\react-boilerplate>npm run build
> todomvc-flux@0.0.3 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! todomvc-flux@0.0.3 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 todomvc-flux@0.0.3 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
我使用的是Win7。我能做错什么?
答案 0 :(得分:3)
我遇到了同样的问题。
您可能会按照教程指示从github repo复制package.json。
如果你检查package.json任务,你会发现它在js /目录中引用了bundle.js和app.js。
在根项目中创建此目录(与package.json相同的目录),现在将完成非运行构建。
本教程听起来好像它将描述在使用react-bootstrap启动时需要进行的所有步骤,但事实并非如此。它更像是一个广泛的笔画总结。