Thread
#multiplatform
    d

    Damiano Giusti

    2 years ago
    I receive the following error:
    Could not find method npm() for arguments [cheerio] on object of type org.jetbrains.kotlin.gradle.plugin.mpp.DefaultKotlinDependencyHandler.
    I’m using the Groovy DSL
    p

    p2000t

    2 years ago
    Hi Damiano, if I understand things correctly, then the syntax you use only works in Kotlin Gradle files (build.gradle.kts). If you use the Groovy DSL, you have to add npm dependencies on source sets using:
    kotlin {
        sourceSets["jsMain"].dependencies {
            implementation(npm("cheerio","1.2.3"))
        }
    }
    For more details, see: https://discuss.kotlinlang.org/t/npm-dependencies-with-kotlin-1-3-40/13174
    d

    Damiano Giusti

    2 years ago
    Thanks @p2000t I’ll try to migrate to kts asap and then i’ll let you know