无法在“项目目录”中检测到支持的目标文件,请参阅文档支持的语言目标,请确保您位于正确的目录中

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

我是 Snyk 的新手,我已经安装了

synk-cli
并在包含两个应用程序的项目的根目录上运行了命令
snyk monitor
, 客户端==reactJS,服务器==python(Django),我已经验证了我的VS代码以连接到我的Snyk帐户,但我收到了这个错误

Could not detect supported target files in /Users/yusuf/projects/ project_name.
Please see our documentation for supported languages and target files: https://snyk.co/udVgQ and make sure you are in the right directory.

我查看了官方文档,它说您可能会因为不支持的语言或我位于错误的目录中而收到此错误,但是我已经检查了两者,正如我提到的我正在运行node(react)和python( django)并且两者都受 Snyk 支持,并且我绝对位于正确的目录中,而且我还通过 cd 到服务器一次仅在语言上运行(在本例中将是 user/yusuf/projects/project_name/server),但仍然得到上面同样的错误

monitor snyk
1个回答
1
投票

我有一些可能有帮助的信息。

  1. CLI
    在当前目录中查找清单。它的默认行为是查找清单并使用
    snyk test
    执行开源扫描。

  2. 您可以让 Snyk 使用

    --all-projects

    在单一存储库中查找多个清单
  3. 识别问题的第一步是确定该根目录中的

    package.json
    pipy
    pip-env
    文件。它不仅位于根目录中,而且是受支持的清单?如果它不在根目录中,我们始终可以指向这些文件。

第二步是使用

--all-projects
运行它,或者使用
snyk test --file=..
来定位每个目标,您可能必须指定包管理器。文档表明要这样做

--file=<FILE>
Specify a package file.
When testing locally or monitoring a project, you can specify the file that Snyk should inspect for package information. When the file is not specified, Snyk tries to detect the appropriate file for your project.

--package-manager=<PACKAGE_MANAGER_NAME>
Specify the name of the package manager when the filename specified with the 
 --file=<FILE> option is not standard. This allows Snyk to find the file.
Example:$ snyk test --file=req.txt --package-manager=pip

这里提到的命令:命令:https://docs.snyk.io/snyk-cli/commands/test

© www.soinside.com 2019 - 2024. All rights reserved.