gpt4 book ai didi

node.js - ReactJs Jest :`jsdom 4. x 及以上版本仅适用于 io.js,不适用于 Node.jsT:

转载 作者:太空宇宙 更新时间:2023-11-03 23:06:53 24 4
gpt4 key购买 nike

package.json:

 {
"name": "flux-pricing",
"version": "0.0.1",
"description": "Pricing component with flux",
"main": "js/app.js",
"dependencies": {
"flux": "^2.0.0",
"jest-cli": "^0.5.0",
"jsdom": ">= 0.1.23 < 4.0.0",
"react": "^0.12.0",
"underscore": "^1.7.0"
},
"devDependencies": {
"browserify": "~6.2.0",
"envify": "~3.0.0",
"react": "^0.12.0",
"reactify": "^0.15",
"watchify": "~2.1.0",
"gulp": "~3.8.9",
"gulp-browserify": "~0.5.0",
"gulp-concat": "~2.4.1",
"node-jsx": "~0.2.0",
"express": "~4.0.0"
},
"scripts": {
"start": "watchify -o js/bundle.js -v -d .",
"build": "browserify . | uglifyjs -cm > js/bundle.min.js",
"test": "jest"
},
"jest": {
"rootDir": "./js"
},
"browserify": {
"transform": [
"reactify",
"envify"
]
}

}

npm 安装后,当我尝试进行 npm 测试时 enter image description here

s\jsdom\lib\jsdom.js:3`jsdom 4.x 及以上版本仅适用于 io.js,不适用于 Node.jsT:https://github.com/tmpvar^意外的 token 非法如何解决这个问题?

最佳答案

我也遇到了同样的问题。解决方案是改用 Jest 0.4。

这是来自 github 的问题。 https://github.com/facebook/jest/issues/469#issuecomment-133105627

实际上,我必须降级到 Jest 0.3 和 Node 10.x 才能使 Jest React 示例正常工作。这是引用 https://github.com/facebook/jest/issues/427

关于node.js - ReactJs Jest :`jsdom 4. x 及以上版本仅适用于 io.js,不适用于 Node.jsT:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32114367/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com