Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env: 'node': No such file or directory #181

Closed
icepuma opened this issue Jan 7, 2025 · 3 comments
Closed

env: 'node': No such file or directory #181

icepuma opened this issue Jan 7, 2025 · 3 comments
Assignees

Comments

@icepuma
Copy link

icepuma commented Jan 7, 2025

Hey,
I upgraded to https://github.com/mpetuska/npm-publish/releases/tag/3.5.1 and Gradle 8.12.
I use id("com.github.node-gradle.node") version "7.1.0" to setup node:

node {
    version.set(nodeVersion)
    download.set(true)
    distBaseUrl.set("<some private registry>")
}

npmPublish uses node.resolvedNodeDir:

npmPublish {
    nodeHome.set(node.resolvedNodeDir)
    packages {
        register("apiSpec") {
            packageName.set("foo-service-api-specification")
            version.set(VERSION)
            scope.set("foo")
            files {
                from(layout.buildDirectory.dir("resources/main"))
            }
        }
    }
    registries {
        register("artifactory") {
            uri.set(ARTIFACTORY_NPM_REPO_URL ?: "")
            authToken.set(ARTIFACTORY_PASSWORD)
        }
    }
}

When I run Gradle, I get:

...
> Task :packApiSpecPackage FAILED
env: 'node': No such file or directory
...

When I downgrade to Gradle 8.11.1 and id("dev.petuska.npm.publish") version "3.4.3" everything works flawlessly.

https://github.com/mpetuska/npm-publish/releases/tag/3.5.0 changed a lot of things regarding node & npm binary resolution. Maybe this introduced a bug?

If you need more input, please let me know :)

@mpetuska
Copy link
Owner

Likely a bug, I'll have a look later this week. Thanks for reporting.

@mpetuska mpetuska self-assigned this Jan 11, 2025
@mpetuska
Copy link
Owner

Fixed with 3.5.2.

P.S. When com.github.node-gradle.node plugin is applied npm-publish integrates with it automatically so you don't have to set nodeHome manually.

@icepuma
Copy link
Author

icepuma commented Jan 11, 2025

It works for my setup. Thanks for taking the time to fix this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants