首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在redux-form的简单示例中运行'npm install‘导致’找不到模块'babel-register‘错误

在redux-form的简单示例中运行'npm install‘导致’找不到模块'babel-register‘错误
EN

Stack Overflow用户
提问于 2017-03-09 08:01:02
回答 1查看 121关注 0票数 0

我想试一下redux-from (https://github.com/erikras/redux-form)中的简单表单示例。该示例的README.md表示

代码语言:javascript
复制
## To run locally

npm安装

npm启动

代码语言:javascript
复制

在本地克隆redux-form项目之后,我cd到examples/simple并运行npm install。它失败并抛出此异常:

代码语言:javascript
复制
> 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

EN

回答 1

Stack Overflow用户

发布于 2017-03-09 08:01:02

example/simple的README.md省略了一些细节。我需要首先在存储库的根级别运行npm install,然后才能cd到simple并在那里运行npm install

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42684274

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档