无法运行测试,打开的文件太多

时间:2016-04-01 21:47:08

标签: node.js reactjs npm jestjs

我现在无法运行测试,我能够在jests教程页面上运行基本的sum.js测试,但我无法测试我的反应代码。我在其他网站上看到移动节点4.x修复了这个问题,但不适合我。任何帮助表示赞赏。

C:\ wamp \ www \ ccRelaunchWorkspace> node -v V4.3.0

我正在运行Windows 7

"devDependencies": {
    "babel-jest": "^9.0.0",
    "babel-polyfill": "*",
    "babel-preset-es2015": "*",
    "babel-preset-react": "*",
    "jest-cli": "*",
    "react-addons-test-utils": "~0.14.0"
  },
  "scripts": {
    "test": "jest"
  },
  "jest": {
    "scriptPreprocessor": "./node_modules/babel-jest",
    "unmockedModulePathPatterns": [
      "./node_modules/react",
      "./node_modules/react-dom",
      "./node_modules/react-addons-test-utils"
    ]
  },

错误:

Using Jest CLI v0.7.0
Error reading file: `C:\wamp\www\ccRelaunchWorkspace\node_modules\babel-preset-e
s2015\node_modules\babel-plugin-transform-es2015-parameters\node_modules\babel-t
raverse\node_modules\babel-code-frame\node_modules\chalk\node_modules\ansi-style
s\package.json`
C:\wamp\www\ccRelaunchWorkspace\node_modules\jest-cli\node_modules\node-haste\li
b\loader\ResourceLoader.js:88
      throw err;
      ^

Error: EMFILE: too many open files, open 'C:\wamp\www\ccRelaunchWorkspace\node_m
odules\babel-preset-es2015\node_modules\babel-plugin-transform-es2015-parameters
\node_modules\babel-traverse\node_modules\babel-code-frame\node_modules\chalk\no
de_modules\ansi-styles\package.json'
    at Error (native)
 npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

1 个答案:

答案 0 :(得分:0)

我已完全删除所有模块,并将所有模块移至dependencies,而不是在devDependencies中删除某些模块,并删除任何相关内容的版本号,并用{{替换版本1}}然后运行*