5***@qq.com
5***@qq.com
  • 发布:2021-09-22 16:23
  • 更新:2022-09-14 17:41
  • 阅读:660

自动化测试插件,执行错误

分类:HBuilderX

HBuilderX:3.2.3.20210825
安装了自动化测试插件:https://ext.dcloud.net.cn/plugin?id=5708

16:17:50.322 [mp-ping-client:mp-weixin] 正在编译中...  
16:17:50.772 [mp-ping-client:mp-weixin]   
16:17:59.800 [mp-ping-client:mp-weixin] Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):  
16:17:59.800 [mp-ping-client:mp-weixin] ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):  
16:17:59.823 [mp-ping-client:mp-weixin] Error: dlopen(/Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/vendor/darwin-x64-83/binding.node, 1): no suitable image found.  Did find:  
16:17:59.840 [mp-ping-client:mp-weixin]     /Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/vendor/darwin-x64-83/binding.node: file too short  
16:17:59.840 [mp-ping-client:mp-weixin]     /Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/vendor/darwin-x64-83/binding.node: file too short  
16:17:59.857 [mp-ping-client:mp-weixin]     at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)  
16:17:59.857 [mp-ping-client:mp-weixin]     at Module.load (internal/modules/cjs/loader.js:950:32)  
16:17:59.869 [mp-ping-client:mp-weixin]     at Function.Module._load (internal/modules/cjs/loader.js:790:14)  
16:17:59.881 [mp-ping-client:mp-weixin]     at Module.require (internal/modules/cjs/loader.js:974:19)  
16:17:59.892 [mp-ping-client:mp-weixin]     at require (internal/modules/cjs/helpers.js:92:18)  
16:17:59.892 [mp-ping-client:mp-weixin]     at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/lib/binding.js:19:10  
16:17:59.904 [mp-ping-client:mp-weixin]     at Object.<anonymous> (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/lib/index.js:14:35)  
16:17:59.904 [mp-ping-client:mp-weixin]     at Module._compile (internal/modules/cjs/loader.js:1085:14)  
16:17:59.915 [mp-ping-client:mp-weixin]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)  
16:17:59.916 [mp-ping-client:mp-weixin]     at Module.load (internal/modules/cjs/loader.js:950:32)  
16:17:59.927 [mp-ping-client:mp-weixin]     at Function.Module._load (internal/modules/cjs/loader.js:790:14)  
16:17:59.927 [mp-ping-client:mp-weixin]     at Module.require (internal/modules/cjs/loader.js:974:19)  
16:17:59.938 [mp-ping-client:mp-weixin]     at require (internal/modules/cjs/helpers.js:92:18)  
16:17:59.939 [mp-ping-client:mp-weixin]     at Object.<anonymous> (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/index.js:8:22)  
16:17:59.954 [mp-ping-client:mp-weixin]     at Module._compile (internal/modules/cjs/loader.js:1085:14)  
16:17:59.954 [mp-ping-client:mp-weixin]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)  
16:17:59.969 [mp-ping-client:mp-weixin]     at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/webpack/lib/NormalModule.js:316:20  
16:17:59.969 [mp-ping-client:mp-weixin]     at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:367:11  
16:17:59.983 [mp-ping-client:mp-weixin]     at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:233:18  
16:17:59.983 [mp-ping-client:mp-weixin]     at runSyncOrAsync (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:143:3)  
16:17:59.999 [mp-ping-client:mp-weixin]     at iterateNormalLoaders (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:232:2)  
16:18:00.015 [mp-ping-client:mp-weixin]     at iterateNormalLoaders (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:221:10)  
16:18:00.031 [mp-ping-client:mp-weixin]     at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:236:3  
16:18:00.048 [mp-ping-client:mp-weixin]     at Object.<anonymous> (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:111:13)  
16:18:00.064 [mp-ping-client:mp-weixin]     at Object.<anonymous> (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js:60:8)  
16:18:00.065 [mp-ping-client:mp-weixin] ERROR  Build failed with errors.

编译失败导致无法自动化测试,正常编译预览是没问题的,就是自动化测试有坑

2021-09-22 16:23 负责人:无 分享
已邀请:
5***@qq.com

5***@qq.com (作者)

/Applications/HBuilderX.app/Contents/HBuilderX/plugins/node/node -v  
v12.22.1

内置node 版本.

官方下载的 compile-node-sass 插件版本

{  
    "name": "sass",  
    "id": "compile-node-sass",  
    "version": "0.0.6",  
    "displayName": "scss/sass编译",  
    "description": "编译scss/sass为css。uni-app编译或对文件右键-外部命令编译时使用",  
    "engines": {  
        "HBuilderX": "^1.0.0"  
    },  
    "external": {  
        "type": "node",  
        "programPath": "${pluginPath}",  
        "executable": "/node_modules/.bin/node-sass",  
        "programName": "node-sass-china",  
        "commands": [  
            {  
                "id": "SASS_COMPILE",  
                "name": "编译scss/sass",  
                "command": [  
                    "${programPath}",  
                    "${file}",  
                    "${fileBasename}.css"  
                ],  
                "extensions": "scss,sass",  
                "key": "",  
                "showInParentMenu": false,  
                "onDidSaveExecution": false  
            }  
        ]  
    },  
    "dependencies": {  
        "node-sass-china": "^4.7.2"  
    },  
    "extensionDependencies": [  
        "npm"  
    ]  
}  
DCloud_HB_WDL

DCloud_HB_WDL

应该是node版本导致的.

compile-node-sass插件,安装的时候,用的是HBuilderX自带的npm和node。

自动化测试插件,默认使用的是用户自己系统里的npm和node。

感谢反馈,后期优化。

  • 5***@qq.com (作者)

    http://cdn.npm.taobao.org/dist/node-sass/v4.7.2/darwin-x64-83_binding.node

    这个文件,已经没有了,赶紧更新一下compile-node-sass插件吧。。。

    2021-09-22 17:12

5***@qq.com

5***@qq.com (作者)

卧槽了。。官方的 scss/sass编译 插件,匹配版本 "node-sass-china": "^4.7.2"。
需要

curl -o binding.node http://cdn.npm.taobao.org/dist/node-sass/v4.7.2/darwin-x64-83_binding.node

但是!!这个版本已经没有了!!!

  • DCloud_HB_WDL

    从这下载吧 https://github.com/sass/node-sass/releases

    2021-09-22 17:18

  • 5***@qq.com (作者)

    回复 DCloud_HB_WDL: 你敢信,我下了v6.0.1版本中的 darwin-x64-83_binding.node,居然能用了。。。。。。。。

    2021-09-22 17:42

5***@qq.com

5***@qq.com - APP开发

各位大佬,怎么解决,现在还有这个问题

该问题目前已经被锁定, 无法添加新回复