Javascript 错误:运行带包的Cypress时找不到绑定文件
当我运行Javascript 错误:运行带包的Cypress时找不到绑定文件,javascript,node.js,cypress,node-gyp,parceljs,Javascript,Node.js,Cypress,Node Gyp,Parceljs,当我运行cypress run--浏览器chrome时,我得到: The function exported by the plugins file threw an error. We invoked the function exported by `C:\Users\LFOLMERT\projects\FE\signup\cypress\plugins\index.js`, but it threw an error. Error: Could not locate the bind
cypress run--浏览器chrome
时,我得到:
The function exported by the plugins file threw an error.
We invoked the function exported by `C:\Users\LFOLMERT\projects\FE\signup\cypress\plugins\index.js`, but it threw an error.
Error: Could not locate the bindings file. Tried:
→ C:\Users\LFOLMERT\projects\FE\signup\node_modules\deasync\build\deasync.node
(...stack trace...)
at tryModuleLoad (module.js:466:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
为了修复它,我尝试了以下命令:
npm rebuild
yarn install --force
npm rebuild --update-binary
rm -rf node_modules && yarn install
rm -rf node_modules && npm install bindings && npm install
cd ./node_modules/deasync && node-gyp rebuild
./node_modules/.bin/electron-rebuild
所有这些都没有帮助,节点gyp在deasync/build
目录中生成了一些内容,但再次运行cypress只会导致不同的错误。正在运行的electron rebuild
正在删除生成的文件
我在package.json中的依赖项:
{
"dependencies": {
"babel": "^6.23.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-register": "^6.26.0",
"bindings": "^1.5.0",
"chai": "^4.2.0",
"cross-env": "^5.2.0",
"cypress": "^3.2.0",
"cypress-failed-log": "^2.4.2",
"cypress-parcel-preprocessor": "^1.0.0",
"electron-builder": "^20.39.0",
"electron-prebuilt": "^1.4.13",
"electron-rebuild": "^1.8.4",
"node-gyp": "^3.8.0",
"parcel-bundler": "^1.12.3"
},
}
My cypress/plugins/index.js:
module.exports = (on) => {
on('task', {
failed: require('cypress-failed-log/src/failed')(),
});
on('file', {
preprocessor: require('cypress-parcel-preprocessor')(),
});
};
相关的:相关的: