无法将 Node js 从 14 升级到 20,并出现错误 -:0308010C:数字信封例程::不支持”错误

问题描述 投票:0回答:1

我当前使用节点版本 14 和 npm 版本 6 设置项目代码。当我尝试升级本地环境或管道代码时,管道中的作业失败。建议如何解决这个问题

我尝试升级 yml 文件中的节点版本,但正如所说的管道失败了

// package.json

{
  "name": "@thub/commute",
  "sideEffects": false,
  "version": "0.1.0",
  "private": true,
  "description": "This package contains components of [Merge](https://merge.microsoft.com) in a reausable fashion.",
  "main": "index.tsx",
  "keywords": [
    "thub",
    "merge",
    "shuttle",
    "connector",
    "transportation"
  ],
  "repository": {
    "type": "git",
    "url": "git+https://microsoftit.visualstudio.com/DefaultCollection/OneITVSO/_git/DWS-MOV-TRA-THUB-SharedComponents"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://microsoftit.visualstudio.com/DefaultCollection/OneITVSO/_git/DWS-MOV-TRA-THUB-SharedComponents/issues"
  },
  "scripts": {
    "adddepend": "run-s lerna:bootstrap lerna:clean lerna:bootstrap:ci lerna:build:ci",
    "firststart": "run-s lerna:clean lerna:bootstrap:ci lerna:build:ci start:client",
    "start": "run-s lerna:bootstrap:ci start:client",
    "start:client": "run-p lerna:watch lerna:serve",
    "start:npmclient": "cd clients/npmclient && npm run serve",
    "lerna:bootstrap": "lerna bootstrap",
    "lerna:build": "lerna run lerna:build",
    "lerna:analyze": "lerna run lerna:analyze",
    "lerna:clean": "lerna run clean && lerna clean --yes",
    "lerna:serve": "lerna run lerna:serve --parallel",
    "lerna:watch": "lerna run lerna:watch --parallel",
    "lint": "eslint ./__mocks__/**/* ./packages/**/* ./clients/**/* --fix",
    "lintpackage": "eslint --fix",
    "test": "run-s lint testonly",
    "test:clearcache": "jest --clearCache",
    "testonly": "jest --config jest.config.js ",
    "test:nocoverage": "jest --config jest.config.js --coverage=false",
    "test:watch": "jest --config jest.config.js --watch",
    "test:watchpackage": "jest --watch",
    "lerna:bootstrap:ci": "lerna bootstrap --ci --include-dependencies",
    "lerna:build:ci": "lerna run lerna:build --ci",
    "lint:ci": "eslint --ext ts,tsx --format junit --output-file ./testresults/eslint.xml",
    "test:ci": "jest --ci --max-workers=2",
    "test:e2e:open": "lerna run cy:open --scope @thub/e2e",
    "test:e2e:chrome": "lerna run test:e2e:chrome --scope @thub/e2e",
    "test:e2e:edge": "lerna run test:e2e:edge --scope @thub/e2e",
    "test:e2e:firefox": "lerna run test:e2e:firefox --scope @thub/e2e"
  },
  "devDependencies": {
    "@babel/core": "^7.23.2",
    "@babel/plugin-transform-modules-commonjs": "^7.10.4",
    "@babel/preset-react": "^7.10.4",
    "@fluentui/date-time-utilities": "^8.5.0",
    "@fluentui/dom-utilities": "^2.2.1",
    "@fluentui/react": "^8.14.1",
    "@fluentui/react-focus": "^8.7.0",
    "@fluentui/react-window-provider": "2.2.1",
    "@fluentui/theme": "^2.6.6",
    "@micro-frontend-react/employee-experience": "^1.0.8",
    "@microsoft/applicationinsights-web": "^2.8.9",
    "@testing-library/dom": "^7.23.0",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^10.4.9",
    "@testing-library/react-hooks": "^3.4.1",
    "@testing-library/user-event": "^12.1.3",
    "@types/dompurify": "^2.0.4",
    "@types/jest": "^26.0.12",
    "@types/react": "^16.9.49",
    "@types/react-adal": "^0.5.0",
    "@types/react-dom": "^16.9.8",
    "@types/react-router-dom": "^5.1.5",
    "@types/styled-components": "^5.1.2",
    "@types/uuid": "^8.3.4",
    "@typescript-eslint/eslint-plugin": "^4.0.1",
    "@typescript-eslint/parser": "^4.0.1",
    "copy-webpack-plugin": "^6.1.0",
    "cpy-cli": "^3.1.1",
    "eslint": "^7.8.0",
    "eslint-config-prettier": "^6.11.0",
    "eslint-plugin-import": "^2.22.0",
    "eslint-plugin-prettier": "^3.1.4",
    "eslint-plugin-react": "^7.20.6",
    "eslint-plugin-react-hooks": "^4.1.0",
    "file-loader": "^6.2.0",
    "fork-ts-checker-notifier-webpack-plugin": "^3.0.0",
    "fork-ts-checker-webpack-plugin": "^5.1.0",
    "identity-obj-proxy": "^3.0.0",
    "jest": "^26.4.2",
    "jest-junit": "^11.1.0",
    "json-schema-to-typescript": "^13.0.1",
    "lerna": "^3.22.1",
    "npm-run-all": "^4.1.5",
    "prettier": "^2.1.1",
    "raw-loader": "^4.0.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-intl": "^5.8.0",
    "react-test-renderer": "^16.13.1",
    "rimraf": "^3.0.2",
    "svgo": "^1.3.2",
    "svgo-loader": "^2.2.1",
    "ts-jest": "^26.3.0",
    "ts-loader": "^8.0.3",
    "typescript": "~4.4.3",
    "webpack": "^4.44.1",
    "webpack-bundle-analyzer": "^4.4.0",
    "webpack-cli": "^3.3.12",
    "webpack-dev-server": "^3.11.0",
    "webpack-merge": "^5.1.3"
  },
  "dependencies": {
    "@azure/msal-browser": "^2.23.0",
    "@coherence-design-system/controls": "^4.0.10",
    "@microsoft/applicationinsights-clickanalytics-js": "^2.8.9",
    "@redux-devtools/extension": "^3.2.2",
    "axios": "^0.27.2",
    "react-device-detect": "^2.2.3",
    "tslib": "^2.3.0"
  }
}
node.js azure-pipelines
1个回答
0
投票

您可以尝试通过以下方法启用旧版 OpenSSL 提供商来解决此问题:

  1. package.json
    的“
    scripts
    ”节点下,更新行

    来自

    "start": "run-s lerna:bootstrap:ci start:client",
    

    "start": "set NODE_OPTIONS=--openssl-legacy-provider && run-s lerna:bootstrap:ci start:client",
    
  2. 设置机器上的环境变量。

    • 在 Linux 和 macOS 上使用 Bash。

      export NODE_OPTIONS=--openssl-legacy-provider
      
    • 在 Windows 上使用 PowerShell。

      $env:NODE_OPTIONS = "--openssl-legacy-provider"
      
© www.soinside.com 2019 - 2024. All rights reserved.