晚上10点左右,刚好说想研究一下uniapp项目中怎么进行自动测试,于是跟着插件的官方教程开始配置测试环境,写好了一个简单的测试脚本,然后图形化操作IDE运行测试,却报错了一大片错误信息,如下所示:

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
02:12:29.703 [sunnywasher-uniapp:mp-weixin] ModuleBuildError: Module build failed (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js):
02:12:29.721 [sunnywasher-uniapp:mp-weixin] Error: dlopen(/Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/vendor/darwin-x64-93/binding.node, 0x0001): tried: '/Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/vendor/darwin-x64-93/binding.node' (not a mach-o file), '/usr/local/lib/binding.node' (no such file), '/usr/lib/binding.node' (no such file)
02:12:29.740 [sunnywasher-uniapp:mp-weixin] at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
02:12:29.762 [sunnywasher-uniapp:mp-weixin] at Module.load (node:internal/modules/cjs/loader:981:32)
02:12:29.763 [sunnywasher-uniapp:mp-weixin] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
02:12:29.783 [sunnywasher-uniapp:mp-weixin] at Module.require (node:internal/modules/cjs/loader:1005:19)
02:12:29.784 [sunnywasher-uniapp:mp-weixin] at require (node:internal/modules/cjs/helpers:102:18)
02:12:29.803 [sunnywasher-uniapp:mp-weixin] at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/lib/binding.js:19:10
02:12:29.804 [sunnywasher-uniapp:mp-weixin] at Object.<anonymous> (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/lib/index.js:14:35)
02:12:29.823 [sunnywasher-uniapp:mp-weixin] at Module._compile (node:internal/modules/cjs/loader:1101:14)
02:12:29.824 [sunnywasher-uniapp:mp-weixin] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
02:12:29.846 [sunnywasher-uniapp:mp-weixin] at Module.load (node:internal/modules/cjs/loader:981:32)
02:12:29.847 [sunnywasher-uniapp:mp-weixin] at Function.Module._load (node:internal/modules/cjs/loader:822:12)
02:12:29.870 [sunnywasher-uniapp:mp-weixin] at Module.require (node:internal/modules/cjs/loader:1005:19)
02:12:29.871 [sunnywasher-uniapp:mp-weixin] at require (node:internal/modules/cjs/helpers:102:18)
02:12:29.892 [sunnywasher-uniapp:mp-weixin] at Object.<anonymous> (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/index.js:8:22)
02:12:29.894 [sunnywasher-uniapp:mp-weixin] at Module._compile (node:internal/modules/cjs/loader:1101:14)
02:12:29.917 [sunnywasher-uniapp:mp-weixin] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
02:12:29.918 [sunnywasher-uniapp:mp-weixin] at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/webpack/lib/NormalModule.js:316:20
02:12:29.940 [sunnywasher-uniapp:mp-weixin] at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:367:11
02:12:29.943 [sunnywasher-uniapp:mp-weixin] at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:233:18
02:12:29.968 [sunnywasher-uniapp:mp-weixin] at runSyncOrAsync (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:143:3)
02:12:29.970 [sunnywasher-uniapp:mp-weixin] at iterateNormalLoaders (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
02:12:29.993 [sunnywasher-uniapp:mp-weixin] at iterateNormalLoaders (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
02:12:29.995 [sunnywasher-uniapp:mp-weixin] at /Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:236:3
02:12:30.017 [sunnywasher-uniapp:mp-weixin] at Object.context.callback (/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
02:12:30.019 [sunnywasher-uniapp: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)

这个报错非常诡异,我最开始怀疑是node版本问题。我用nvm不断切换不同版本,甚至把HbuilderX的插件里面的node删除,用nvm使用的node创造软连接给它。然而并不解决问题,我google+sogou连续查阅相关问题,但是大部分都在说rebuild一下sass之类的。二node-sass本身安装也是正常的,我陷入了思维的死循环。最后熬夜到了2点,终于发现了:原来是通过淘宝cdn资源下载的binding.node文件有问题,去github上下载就是正确的了。github地址为:https://github.com/sass/node-sass/releases

以我本人为例,我下载了这个版本的文件https://github.com/sass/node-sass/releases/download/v7.0.1/darwin-x64-93_binding.node到/Applications/HBuilderX.app/Contents/HBuilderX/plugins/compile-node-sass/node_modules/node-sass-china/vendor/darwin-x64-93文件夹下

并把darwin-x64-93_binding.node文件重命名为binding.node

来来回回折腾,还是报错信息是最准确了,说的是binding.node is not a mach-o file ,说明可能该文件破碎或者无法识别,以后还是要相信科学,相信报错,少走弯路。

一个不常遇到的HbuilderX自动化测试运行问题的更多相关文章

  1. 一个基于.NET平台的自动化/压力测试系统设计简述

    AutoTest系统设计概述 AutoTest是一个基于.NET平台实现的自动化/压力测试的系统,可独立运行于windows平台下,支持分布式部署,不需要其他配置或编译器的支持.(本质是一个基于协议的 ...

  2. 开源自己用python封装的一个Windows GUI(UI Automation)自动化工具,支持MFC,Windows Forms,WPF,Metro,Qt

    首先,大家可以看下这个链接 Windows GUI自动化测试技术的比较和展望 . 这篇文章介绍了Windows中GUI自动化的三种技术:Windows API, MSAA - Microsoft Ac ...

  3. ShutIt:一个基于 Python 的 shell 自动化框架

    ShutIt是一个易于使用的基于shell的自动化框架.它对基于python的expect库(pexpect)进行了包装.你可以把它看作是“没有痛点的expect”.它可以通过pip进行安装. Hel ...

  4. Ansible :一个配置管理和IT自动化工具

    编译文章:LCTT  https://linux.cn/article-4215-1.html 译者: felixonmars 文章地址:https://linux.cn/article-4215-1 ...

  5. python tesserocr ImportError: dll loading failed 一个不常遇见的错误,以及简单的python安装方法~

    废话不多说了,这是写给小白的了. 本人有c#,c/c++开发经验,最近因为偶然的原因,开始接触python,遇到一个棘手的问题,一位朋友在安装tesserocr 包后遇到一个错误,重新安装数次不能解决 ...

  6. 一个免费的自动化跨平台测试JavaScript的工具——BrowserSwarm

    BrowserSwarm是一个免费工具,能够自动化跨平台测试JavaScript.

  7. 小技巧 | Get 到一个 Web 自动化方案,绝了!

    1. 前言 大家好,我是安果! 无论是 Chrome,还是 Firefox 浏览器,它们的强大性在很大程度上都是依赖于海量的插件,让我们能高效办公 那我们是否可以编写一个插件,让浏览器自动化完成一些日 ...

  8. IOS自动化测试之UIAutomation

    通过Xcode工具编写运行测试脚本 1.当你有了一个应用的源代码之后,在Xcode工具中,首先选中被测应用,然后点击菜单栏中的“Product-Profile”,则会弹出Instruments工具,在 ...

  9. 使用 PowerShell 自动化 CloudServices 发布

    在软件的开发过程中,自动化的编译和部署能够带来很多的优势.如果可以通过一个脚本实现软件的自动化部署,那么就可以节省大量的时间去做其它事情. 下面介绍如何将云应用程序通过 PowerShell 自动发布 ...

随机推荐

  1. 学习java的第七天

    一.今日收获 1.看完全学习手册上java关键字与标识符两节 2.了解了java的关键字与标识符 二.今日难题 1.基本都理解 三.明日目标 1.继续看完全学习手册上的内容 2.加油!

  2. Pytorch学习笔记08----优化器算法Optimizer详解(SGD、Adam)

    1.优化器算法简述 首先来看一下梯度下降最常见的三种变形 BGD,SGD,MBGD,这三种形式的区别就是取决于我们用多少数据来计算目标函数的梯度,这样的话自然就涉及到一个 trade-off,即参数更 ...

  3. acupuncture

    acute+puncture. [woninstitute.edu稻糠亩] To understand the basics of acupuncture, it is best to familia ...

  4. CSS相关,手画三角形,正方形,扇形

    三角形 实现一个三角形 <!DOCTYPE html> <html> <head> <title>三角形</title> <style ...

  5. 【leetcode】952. Largest Component Size by Common Factor(Union find)

    You are given an integer array of unique positive integers nums. Consider the following graph: There ...

  6. deque、queue和stack深度探索(上)

    deque是可双端扩展的双端队列,蓝色部分就是它的迭代器类,拥有四个指针,第一个cur用来指向当前元素,first指向当前buffer头部,last指向当前buffer尾部,node指向map自己当前 ...

  7. C++类的定义,成员函数的定义,对象的创建与使用

    类是一个模板,可用类生成一系列可用的实例.例如 int B就是生成了一个符合int的数据B,类也是一样,使用类名就可以直接生成一个实例, 该实例中包含类中所有的数据类型和对这些数据的操作方法. 首先, ...

  8. MBean代码例子

    public class ServerImpl { public final long startTime; public ServerImpl() { startTime = System.curr ...

  9. Function overloading and return type

    In C++ and Java, functions can not be overloaded if they differ only in the return type. For example ...

  10. 【Spring Framework】Spring入门教程(八)Spring的事务管理

    事务是什么? 事务:指单个逻辑操作单元的集合. 在操作数据库时(增删改),如果同时操作多次数据,我们从业务希望,要么全部成功,要么全部失败.这种情况称为事务处理. 例如:A转账给B. 第一步,扣除A君 ...