Skip to content

Cannot pass token to npm script anymore #187

Open
@wintercounter

Description

@wintercounter

This started to happen with the recent updates. Until now this was working fine:

// package.json
{
    "scripts": {
        "release": "conventional-github-releaser -t"
    }
}

npm run release -- MY_TOKEN

But I started to get the following error:

C:\...es\conventional-github-releaser\node_modules\meow\node_modules\minimist-options\index.js:101
                                        throw new TypeError(`Expected "${key}" default value to be of type "${expectedType}", got ${prettyPrint(defaultType)}`);
                                        ^

TypeError: Expected "token" default value to be of type "string", got "undefined"
    at C:\node_modules\conventional-github-releaser\node_modules\meow\node_modules\minimist-options\index.js:101:12
    at Array.forEach (<anonymous>)
    at buildOptions (C:\node_modules\conventional-github-releaser\node_modules\meow\node_modules\minimist-options\index.js:64:23)
    at meow (C:\node_modules\conventional-github-releaser\node_modules\meow\index.js:136:18)
    at Object.<anonymous> (C:\node_modules\conventional-github-releaser\src\cli.js:9:13)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

Activity

cookiescrumbs

cookiescrumbs commented on Jul 22, 2020

@cookiescrumbs

I'm getting the same. I've locked to v3.1.3.

Hartorn

Hartorn commented on Aug 24, 2020

@Hartorn

We cannot even run in cli conventional-github-releaser --help, it breaks also with the same message

added a commit that references this issue on Sep 11, 2020
3aebb4f
linked a pull request that will close this issue on Sep 11, 2020
added a commit that references this issue on Sep 11, 2020
47fcd1c
thesmiley1

thesmiley1 commented on Nov 26, 2020

@thesmiley1

I'm not sure about previous behavior, but I was able to work around the issue by supplying a CONVENTIONAL_GITLAB_RELEASER_TOKEN environment variable, even just a dummy one to get the help working, e.g.:

CONVENTIONAL_GITLAB_RELEASER_TOKEN=asdf conventional-gitlab-releaser --help

Obviously there is still a bug, though: it shouldn't take a dummy token to print the help documentation.

carmanchris31

carmanchris31 commented on Jan 25, 2021

@carmanchris31

Updating https://github.com/conventional-changelog/releaser-tools/blob/master/packages/conventional-github-releaser/src/cli.js#L50 should fix this:

-       default: process.env.CONVENTIONAL_GITHUB_RELEASER_TOKEN,
+       default: process.env.CONVENTIONAL_GITHUB_RELEASER_TOKEN || '',
lvjiaxuan

lvjiaxuan commented on Sep 16, 2022

@lvjiaxuan

v3.1.5 still error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @wintercounter@cookiescrumbs@Hartorn@carmanchris31@lvjiaxuan

      Issue actions

        Cannot pass token to npm script anymore · Issue #187 · conventional-changelog/releaser-tools