首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行MERN测试时出现问题

运行MERN测试时出现问题
EN

Stack Overflow用户
提问于 2016-11-14 12:30:50
回答 2查看 359关注 0票数 1

我正在考虑在一个新项目中使用MERN框架,到目前为止,我对我所看到的并不感到鼓舞。我已经遵循了通过mern-cli设置项目的指导,项目确实被创建并正确运行,但当我执行...

npm run test

我得到..。

代码语言:javascript
复制
> mern-starter@2.0.0 test /Users/acooley/workspace/node_datacenter
> cross-env NODE_ENV=test PORT=8080 MONGO_URL=mongodb://localhost:27017/mern-test node_modules/.bin/nyc node --harmony-proxies node_modules/.bin/ava

/usr/local/Cellar/node/7.1.0/bin/node: bad option: --harmony-proxies
----------|----------|----------|----------|----------|----------------| File      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
----------|----------|----------|----------|----------|----------------| All files |      100 |      100 |      100 |      100 |                |
----------|----------|----------|----------|----------|----------------|


npm ERR! Darwin 16.1.0 npm ERR! argv "/usr/local/Cellar/node/7.1.0/bin/node" "/usr/local/bin/npm" "run" "test" npm ERR! node v7.1.0 npm ERR! npm  v3.10.9 npm ERR! code ELIFECYCLE npm ERR! mern-starter@2.0.0 test: `cross-env NODE_ENV=test PORT=8080 MONGO_URL=mongodb://localhost:27017/mern-test node_modules/.bin/nyc node --harmony-proxies node_modules/.bin/ava` npm ERR! Exit status 9 npm ERR!  npm ERR! Failed at the mern-starter@2.0.0 test script 'cross-env NODE_ENV=test PORT=8080 MONGO_URL=mongodb://localhost:27017/mern-test node_modules/.bin/nyc node --harmony-proxies node_modules/.bin/ava'. 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 mern-starter package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR!     cross-env NODE_ENV=test PORT=8080 MONGO_URL=mongodb://localhost:27017/mern-test node_modules/.bin/nyc node --harmony-proxies node_modules/.bin/ava npm ERR! You can get information on how to open an issue for this project with: npm ERR!    npm bugs mern-starter npm ERR! Or if that isn't available, you can get their info via: npm ERR!     npm owner ls mern-starter npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR!     /Users/acooley/workspace/node_datacenter/npm-debug.log

其他人也遇到过这种情况吗?我真的很想使用这个框架,但是没有函数式TDD是一种阻碍。

EN

回答 2

Stack Overflow用户

发布于 2017-05-28 02:35:03

运行MERN2.0(当前最新版本)的测试用例失败,节点为v6+。下面是我在OS上做的测试:

代码语言:javascript
复制
$ brew remove node
$ brew install nvm
$ nvm install 5
$ nvm alias default 5
$ npm install -g mern-cli
$ mern init your_new_app
$ cd your_new_app
$ npm install
$ npm run test
票数 1
EN

Stack Overflow用户

发布于 2017-09-29 21:30:47

在另一篇文章/站点上找到:更新package.js中的test脚本,并将--harmony-proxies更改为--harmony。(参考n-makarov在2月12日发表评论:https://github.com/coryhouse/react-slingshot/issues/366 )

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

https://stackoverflow.com/questions/40581912

复制
相关文章

相似问题

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