构建 kotlin/js 项目时出现异常:错误 package.json:名称包含非法字符

Exception when building a kotlin/js project: error package.json: Name contains illegal characters

正在尝试构建 kotlin/js 项目并出现以下异常:

error package.json: Name contains illegal characters

项目在这里:

https://github.com/darran-kelinske-fivestars/cordova-alternative-pattern/tree/kotlin_multiplatform/js

完整输出:

3:05:37 PM: Executing task 'build'...

Executing tasks: [build] in project /rom/source/fivestars/CordovaAlternativePattern/js


> Configure project :SharedCode
Kotlin Multiplatform Projects are an experimental feature.

> Task :SharedCode:jsPackageJson
> Task :js:packageJson
> Task :js:testPackageJson
> Task :kotlinNodeJsSetup SKIPPED

> Task :kotlinNpmInstall FAILED
error package.json: Name contains illegal characters

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kotlinNpmInstall'.
>                 Process 'Resolving NPM dependencies using yarn' returns 1

                  yarn install v1.21.1
  info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 885ms
4 actionable tasks: 4 executed
3:05:38 PM: Task execution finished 'build'.

问题出在我在 settings.gradle

中的 rootProject.name 定义上

我不得不改变

rootProject.name='Cordova Alternative Pattern'

rootProject.name='CordovaAlternativePattern'