magk98
magk98

Reputation: 41

build.gradle.kts unresolved reference: npm

I am trying to learn kotlin and I was following tutorial Building Web Applications with React and Kotlin/JS from official kotlin site, but I have a problem with build.gradle.kts file, it says:

unresolved reference

every time npm appears in this file.

I did everything like in the tutorial and honestly don't know what's a problem here. Do I need to include something else? I have npm installed on my computer so I believe this is another problem.

Upvotes: 2

Views: 1159

Answers (2)

WildStudio
WildStudio

Reputation: 1

I hit the same issue with following the same tutorial I resolved it declaring npm dependencies like:

kotlin {
    sourceSets["main"].dependencies {
        implementation(npm("react", "16.12.0"))
        implementation(npm("react-dom", "16.12.0"))
    }
}

see

Upvotes: 0

magk98
magk98

Reputation: 41

Ok, so the problem was with Intellij. If it shows you that you have up-to-date version of Kotlin and it's not 3.70 then you need to update Intellij, because it's Intellij issue. After updating intellij, kotlin and changing plugin version in build.gradle.kts everything works fine. Maybe this answer will help someone with same issue.

Upvotes: 2

Related Questions