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

2

8

Trying to build the a kotlin/js project and getting the following exception:

error package.json: Name contains illegal characters

The project is here:

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

Full output:

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'.
Inactivate answered 4/3, 2020 at 21:11 Comment(0)
I
18

The issue was with my rootProject.name definition in settings.gradle

I had to change

rootProject.name='Cordova Alternative Pattern'

to

rootProject.name='CordovaAlternativePattern'

Inactivate answered 4/3, 2020 at 21:46 Comment(0)
A
0

The same error occurs if you use any 'illegal' non-English characters in rootProject.name. To resolve this, change it to English letters without spaces or other special characters.

And yes, it may be necessary to report this issue to JB, at the very least by enabling proper logging.

Attenweiler answered 18/8 at 19:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.