【发布时间】:2021-02-26 13:18:30
【问题描述】:
我想用 dub 运行我的第一个项目。我用dub init sandbox'初始化了这个项目,然后用dub run运行它。但是配音是这么说的:Configuration 'application' of package sandbox contains no source files. Please add {"targetType": "none"} to its package description to avoid building it. Package with target type "none" must have dependencies to build.
我不明白,为什么会发生,因为我的项目中有源文件夹。这是一个项目树:
-
沙盒
- 来源
- app.d
- dub.json
- 来源
还有 dub.json 文件:
{
"authors": [
"MAX_PC"
],
"copyright": "Copyright © 2021, MAX_PC",
"description": "A minimal D application.",
"license": "proprietary",
"name": "sandbox"
}
编辑: 这是一个完整的输出
D:\DEVELOPMENT\[ D ]>dub init sandbox
Package recipe format (sdl/json) [json]:
Name [sandbox]:
Description [A minimal D application.]:
Author name [MAX_PC]:
License [proprietary]:
Copyright string [Copyright ┬й 2021, MAX_PC]:
Add dependency (leave empty to skip) []:
Successfully created an empty project in 'D:\DEVELOPMENT\[ D ]\sandbox'.
Package successfully created in sandbox
D:\DEVELOPMENT\[ D ]>cd sandbox
D:\DEVELOPMENT\[ D ]\sandbox>dub run
Configuration 'application' of package sandbox contains no source files. Please add {"targetType": "none"} to its package description to avoid building it.
Package with target type "none" must have dependencies to build.
【问题讨论】:
-
这里不会发生。也许添加完整的 shell 脚本,并确保您在正确的目录中运行命令。
-
我在 dub.json 所在的“沙盒”文件夹中运行 dub。抱歉,我不太明白,如何添加完整的 shell 脚本。
-
在终端中,从头开始重现问题,然后选择终端中的所有文本,包括您键入的命令和运行这些命令的输出(结果),并将其添加到您的问题中一个代码块。
-
哦,我明白了。谢谢,我会改的!
-
是的,这是因为你的路径中有奇怪的字符,正如你已经发现的那样:)
标签: directory package project d dub