我正在尝试向 npm 发布一个包。当 CircleCI 尝试运行semantic-release
时,它会引发以下错误:
/home/circleci/src/node_modules/semantic-release/node_modules/execa/index.js:18
const env = extendEnv ? {...process.env, ...envOption} : envOption;
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:511:25)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/circleci/src/node_modules/semantic-release/bin/semantic-release.js:9:13)
at Module._compile (module.js:541:32)
npm ERR! code ELIFECYCLE
我的package.json
devDependencies 如下:
"devDependencies": {
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.7",
"@semantic-release/npm": "^7.0.5",
"@semantic-release/release-notes-generator": "^9.0.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"jest": "^25.5.1",
"marked": "^0.4.0",
"npm-audit-resolver": "^2.2.0",
"prettier": "^2.0.5",
"semantic-release": "^16.0.4",
"semantic-release-cli": "^5.3.1"
},
我已经在 CircleCI 中为 github 和 npm 设置了环境变量,并在我的 CircleCI 配置文件中使用了它们。在我的 CircleCI 配置中npm ci
运行之前,我还有一步。semantic-release
想知道是否有人遇到过这个问题并解决了这个问题?(如有需要,我可以提供更多信息。)