为什么 Snyk GitHub 操作会因“.. 你的 package.json 和未定义的可能不同步......”而失败
Why does Snyk GitHub Actions fail due to ".. Your package.json and undefined are probably out of sync ..."
你好 Whosebugians。
我目前正尝试在我的 GitHub Actions 工作流程中,在一个 Node 项目中设置 Snyk。
这个想法是 运行 两项工作:
- 根据其文档 (found here) 的 Snyk 安全门,例如保持简单的第一个示例。
- 构建和推送作业(按预期独立运行)
但是,当尝试 运行 第一个作业时,它在“运行 Snyk 以检查漏洞”步骤中失败并显示以下日志:
Run snyk/actions/node@master
with:
command: test
json: false
env:
REGISTRY: ghcr.io
IMAGE_NAME: <IMAGENAME>
SNYK_TOKEN: ***
/usr/bin/docker run --name snyksnyknode_3aa871 --label 6a6825 --workdir /github/workspace --rm -e REGISTRY -e IMAGE_NAME -e SNYK_TOKEN -e INPUT_ARGS -e INPUT_COMMAND -e INPUT_JSON -e SNYK_INTEGRATION_NAME -e SNYK_INTEGRATION_VERSION -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/digitaliseringsradarn-frontend/digitaliseringsradarn-frontend":"/github/workspace" snyk/snyk:node "snyk" "test" "--severity-threshold=high --fail-on=upgradable"
Dependency bindings was not found in undefined. Your package.json and undefined are probably out of sync. Please run "undefined" and try again.
最后一部分 Dependency bindings was not found in undefined. Your package.json and undefined are probably out of sync. Please run "undefined" and try again.
是我不明白它如何帮助我调试的部分。
这是已知解决方案的已知问题吗?如果不是,我怎样才能找到 undefined 指的是什么?
提前谢谢你,
拉乌尔
目前,似乎删除 node_modules/
和 package-lock.json
并用 npm install
重新生成它们可以解决这个问题。
<in root>
rm -rf node_modules/
rm package-lock.json
npm install
你好 Whosebugians。
我目前正尝试在我的 GitHub Actions 工作流程中,在一个 Node 项目中设置 Snyk。 这个想法是 运行 两项工作:
- 根据其文档 (found here) 的 Snyk 安全门,例如保持简单的第一个示例。
- 构建和推送作业(按预期独立运行)
但是,当尝试 运行 第一个作业时,它在“运行 Snyk 以检查漏洞”步骤中失败并显示以下日志:
Run snyk/actions/node@master
with:
command: test
json: false
env:
REGISTRY: ghcr.io
IMAGE_NAME: <IMAGENAME>
SNYK_TOKEN: ***
/usr/bin/docker run --name snyksnyknode_3aa871 --label 6a6825 --workdir /github/workspace --rm -e REGISTRY -e IMAGE_NAME -e SNYK_TOKEN -e INPUT_ARGS -e INPUT_COMMAND -e INPUT_JSON -e SNYK_INTEGRATION_NAME -e SNYK_INTEGRATION_VERSION -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/digitaliseringsradarn-frontend/digitaliseringsradarn-frontend":"/github/workspace" snyk/snyk:node "snyk" "test" "--severity-threshold=high --fail-on=upgradable"
Dependency bindings was not found in undefined. Your package.json and undefined are probably out of sync. Please run "undefined" and try again.
最后一部分 Dependency bindings was not found in undefined. Your package.json and undefined are probably out of sync. Please run "undefined" and try again.
是我不明白它如何帮助我调试的部分。
这是已知解决方案的已知问题吗?如果不是,我怎样才能找到 undefined 指的是什么?
提前谢谢你, 拉乌尔
目前,似乎删除 node_modules/
和 package-lock.json
并用 npm install
重新生成它们可以解决这个问题。
<in root>
rm -rf node_modules/
rm package-lock.json
npm install