Npm-install fails with kotlin-frontend-plugin + kotlinx-html-js

I have a working project based on kotlin-frontend-plugin.

As a next step I wanted to add kotlinx-html-js to the project.
I defined the Gradle dependency:

dependencies {
    ...
    compile "org.jetbrains.kotlinx:kotlinx-html-js:0.6.11"
}

But the command line Gradle build fails:

Task :client:npm-install
npm ERR! code ETARGET
npm ERR! notarget No matching version found for kotlinx-html-js@0.6.11
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn’t exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of ‘client’
npm ERR! notarget

What should I change?

Besides, why does the npm-install task try to download kotlinx-html-js@0.6.11 even if it is not defined in the kotlinFrontend.npm {} block as an npm dependency?

17 http fetch GET 304 https://registry.npmjs.org/kotlinx-html-js 1109ms (from cache)
18 silly registry:manifest no matching version for kotlinx-html-js@0.6.11 in the cache. Forcing revalidation
19 http fetch GET 304 https://registry.npmjs.org/kotlinx-html-js 26ms (from cache)
20 silly fetchPackageMetaData error for kotlinx-html-js@0.6.11 No matching version found for kotlinx-html-js@0.6.11
21 silly registry:manifest no matching version for kotlinx-html-js@0.6.11 in the cache. Forcing revalidation
22 http fetch GET 304 https://registry.npmjs.org/kotlinx-html-js 33ms (from cache)
23 silly fetchPackageMetaData error for kotlinx-html-js@0.6.11 No matching version found for kotlinx-html-js@0.6.11

Does 0.6.4 version work for you? It seems to be the only published version: https://www.npmjs.com/package/kotlinx-html-js

See also Cannot use kotlinx-html-js for NodeJS (Gradle + NPM) · Issue #95 · Kotlin/kotlinx.html · GitHub

You are right, it is working with 0.6.4.
There are two possibilities:

  • Nobody is using kotlinx-html with kotlin-frontend-plugin
  • They use it with a different config, eg. somehow managed npm to use the kotlinx-html-js.js file included in the jar

:thinking: