Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 使用npx的GitHub操作失败,消息为/usr/bin/env:';节点';:没有这样的文件或目录_Node.js_Github Actions_Npx - Fatal编程技术网

Node.js 使用npx的GitHub操作失败,消息为/usr/bin/env:';节点';:没有这样的文件或目录

Node.js 使用npx的GitHub操作失败,消息为/usr/bin/env:';节点';:没有这样的文件或目录,node.js,github-actions,npx,Node.js,Github Actions,Npx,我正在创建一个依赖npx运行语义发布的nodejs GitHub操作: src/index.ts(摘录,捆绑到dist/index.js) 从'@actions/core'导入*作为核心 从'@actions/exec'导入*作为exec 从“@actions/github”导入*作为github ;(异步()=>{ 常量注册表:字符串=`https://npm.pkg.github.com/${github.context.repo.owner}` const githubToken:stri

我正在创建一个依赖npx运行语义发布的nodejs GitHub操作:

src/index.ts
(摘录,捆绑到
dist/index.js

从'@actions/core'导入*作为核心
从'@actions/exec'导入*作为exec
从“@actions/github”导入*作为github
;(异步()=>{
常量注册表:字符串=`https://npm.pkg.github.com/${github.context.repo.owner}`
const githubToken:string=core.getInput('github_token',{required:true})
等待exec.exec('npx',['semantic-release']{
NPM_配置_注册表:githubRegistry,
NPM_代币:githubToken,
GITHUB_令牌:githubToken
})
})()
action.yml
(摘录)

输入:
github_令牌:
必填项:true
跑:
使用:节点12
main:dist/index.js
.github/workflows/release.yml

关于:
推送:
分支机构:
-主要
工作:
发布:
运行于:ubuntu最新版本
步骤:
-用途:行动/checkout@v2
-用途:操作/设置-node@v1
与:
节点版本:12
-跑步:纱线
-用途:/
与:
github_令牌:${{secrets.github_令牌}
在GitHub上运行发布工作流时,它会失败,并产生以下输出:

/opt/hostedtoolcache/node/12.19.0/x64/bin/npx semantic-release
/usr/bin/env: 'node': No such file or directory
Error: The process '/opt/hostedtoolcache/node/12.19.0/x64/bin/npx' failed with exit code 127
看起来npx正在尝试运行节点,但找不到它


非常感谢您的帮助,谢谢:)

Julien,您能解决这个问题吗?Julien,您能解决这个问题吗?