node.js - 运行单元测试管道时 Github 操作错误

标签 node.js yaml devops github-actions

从昨天开始,我在 github 操作上运行单元测试时遇到了这个错误,我无法弄清楚为什么会发生这个错误。你能帮我解决这个问题吗?

> whisper-ui@1.0.0 test
> react-scripts test --coverage --watchAll=false --updateSnapshot



#
# Fatal error in , line 0
# Check failed: !holder_map.has_named_interceptor().
#
#
#
#FailureMessage Object: 0x7ffd7ab08610
 1: 0xb691f1  [/opt/hostedtoolcache/node/16.9.0/x64/bin/node]
 2: 0x1bf3094 V8_Fatal(char const*, ...) [/opt/hostedtoolcache/node/16.9.0/x64/bin/node]
 3: 0x10ac4a1 v8::internal::compiler::JSGlobalObjectRef::GetPropertyCell(v8::internal::compiler::NameRef const&, v8::internal::compiler::SerializationPolicy) const [/opt/hostedtoolcache/node/16.9.0/x64/bin/node]
 6: 0x1e61ba3 v8::internal::compiler::JSNativeContextSpecialization::ReduceNamedAccess(v8::internal::compiler::Node*, v8::internal::compiler::Node*, v8::internal::compiler::NamedAccessFeedback const&, v8::internal::compiler::AccessMode, v8::internal::compiler::Node*) [/opt/hostedtoolcache/node/16.9.0/x64/bin/node]
Error: Process completed with exit code 1.
那是我为 github action 写的 yaml 代码
web_test:
    name: Web Tests
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [14.x, 16.x]
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Set up Node
        uses: actions/setup-node@v2
        with:
          node-version: 16.x
          cache: "npm"
          cache-dependency-path: ./web/package-lock.json

      - name: Install Dependencies
        working-directory: ./web
        run: npm install

      - name: Lint React Code
        working-directory: ./web
        run: npm run lint

      - name: Run React Tests
        working-directory: ./web
        run: npm run test

      - name: Upload Coverage report to CodeCov
        uses: codecov/codecov-action@v1.0.0
        with:
          # Make sure to add to GitHub secrets!
          token: ${{secrets.CODECOV_TOKEN}}

最佳答案

这是 Node 16.9.0 中存在的 V8 中的上游错误。在发布新版本之前,请降级到 16.8.0
以下是有关该错误的更多信息:
https://github.com/nodejs/node/issues/40030

关于node.js - 运行单元测试管道时 Github 操作错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69118749/

相关文章:

r - 错误 : pandoc document conversion failed with error 2 with pkgdown/rmarkdown

python - Python yaml.load 中遇到 "unacceptable character #x0095: special characters are not allowed in "<unicode string >", position 268"错误

kubernetes - 验证Kubernetes对象创建

node.js - Jhipster : cannot use jhipster-generator

node.js - console.log 和 process._rawDebug 之间的区别

node.js - 如何使用 Node js将base64数据作为图像上传到s3?

node.js - 发送 Node.js 后无法设置 header

ruby - 如何将 yaml 转换为电子表格?

Jenkins:管理多个环境配置和部署

kubernetes - 为命名空间创建管理员角色