I wanted to run my first project with dub. I initialized the project with dub init sandbox
', then ran it with dub run
. But dub said this:
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.
I don't understand, why does it happen because I have source folder in my project. Here's a project tree:
And dub.json file:
{
"authors": [
"MAX_PC"
],
"copyright": "Copyright © 2021, MAX_PC",
"description": "A minimal D application.",
"license": "proprietary",
"name": "sandbox"
}
EDIT: This is a whole output
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.
The problem is solved! Spaces in the path to the project were the reason! So, don't write paths like me: D:\DEVELOPMENT\[ D ]