我想试一下redux-from (https://github.com/erikras/redux-form)中的简单表单示例。该示例的README.md表示
## To run locallynpm安装
npm启动
在本地克隆redux-form项目之后,我cd到examples/simple并运行npm install。它失败并抛出此异常:
> redux-form@6.5.0 prepublish /Users/antkong/wd/redux-form
> npm run test && npm run clean && npm run build
> redux-form@6.5.0 test /Users/antkong/wd/redux-form
> mocha --compilers js:babel-register --recursive --recursive "src/**/__tests__/*" --require src/__tests__/setup.js
module.js:341
throw err;
^
Error: Cannot find module 'babel-register'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at /usr/local/lib/node_modules/mocha/bin/_mocha:337:3
at Array.forEach (native)
at Object.<anonymous> (/usr/local/lib/node_modules/mocha/bin/_mocha:329:19)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:148:18)
at node.js:405:3
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/Cellar/node5/5.11.1/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v5.11.1
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! redux-form@6.5.0 test: `mocha --compilers js:babel-register --recursive --recursive "src/**/__tests__/*" --require src/__tests__/setup.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the redux-form@6.5.0 test script 'mocha --compilers js:babel-register --recursive --recursive "src/**/__tests__/*" --require src/__tests__/setup.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the redux-form package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! mocha --compilers js:babel-register --recursive --recursive "src/**/__tests__/*" --require src/__tests__/setup.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs redux-form
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls redux-form
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /Users/antkong/wd/redux-form/npm-debug.log
npm ERR! addLocal Could not install /Users/antkong/wd/redux-form
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/Cellar/node5/5.11.1/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v5.11.1
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! redux-form@6.5.0 prepublish: `npm run test && npm run clean && npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the redux-form@6.5.0 prepublish script 'npm run test && npm run clean && npm run build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the redux-form package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run test && npm run clean && npm run build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs redux-form
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls redux-form
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/antkong/wd/redux-form/examples/simple/npm-debug.log我怎么才能修复它?我正在使用
osx 10.12.1 npm 2.10.6节点5.11.1
发布于 2017-03-09 08:01:02
example/simple的README.md省略了一些细节。我需要首先在存储库的根级别运行npm install,然后才能cd到simple并在那里运行npm install。
https://stackoverflow.com/questions/42684274
复制相似问题