3

我正在尝试从 github (link)安装 react.js Flux-todomvc 教程,但是在克隆 repo、运行 NPM install、然后运行 ​​NPM start 之后,NPM 返回一个如下所示的错误:

peter@peter-ThinkPad-X220 ~/projects/www/flux-todomvc/flux $ npm install

> flux@2.0.3 prepublish /home/peter/projects/www/flux-todomvc/flux
> gulp publish

[15:36:43] Using gulpfile ~/projects/www/flux-todomvc/flux/Gulpfile.js
[15:36:43] Starting 'publish'...
[15:36:43] Starting 'clean'...
[15:36:43] Finished 'clean' after 14 ms
[15:36:43] Starting 'lib'...
[15:36:43] Finished 'lib' after 69 ms
[15:36:43] Starting 'browserify'...
[15:36:43] Finished 'browserify' after 85 ms
[15:36:43] Starting 'build'...
[15:36:43] Finished 'build' after 4.94 μs
[15:36:43] Finished 'publish' after 172 ms
peter@peter-ThinkPad-X220 ~/projects/www/flux-todomvc/flux $ npm start
npm ERR! Linux 3.13.0-37-generic
npm ERR! argv "node" "/home/peter/.nvm/versions/node/v0.12.0/bin/npm" "start"
npm ERR! node v0.12.0
npm ERR! npm  v2.10.1

npm ERR! missing script: start
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/peter/projects/www/flux-todomvc/flux/npm-debug.log

任何人都知道如何解决这个问题?

4

1 回答 1

3

我想通了,也许这是一个非常简单的错误,但也许这会帮助其他发现文档不清楚的人(就像我一样)。

运行 npm 命令(npm install 和 npm start)时,您需要位于示例项目的根文件夹中,而不是 github 存储库的根文件夹中。

换句话说,要安装和运行 todoMVC 示例项目,您应该在以下目录中:

flux/examples/flux-todomvc

不在此目录中:

flux/
于 2015-05-25T23:00:10.757 回答