Skip to content

Command failed with exit code 1: npm version 0.22.2 --userconfig  #651

@CalicoNino

Description

@CalicoNino

Getting this error:

 Error: Command failed with exit code 1: npm version 0.22.2 --userconfig /tmp/83437ffc97d16db8f71020513bd690ce/.npmrc --no-git-tag-version --allow-same-version
npm ERR! code ERR_INVALID_ARG_TYPE
npm ERR! The "from" argument must be of type string. Received undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2023-07-31T05_33_03_943Z-debug-0.log
v0.22.2
    at makeError (file:///home/runner/work/testing/testing/node_modules/semantic-release/node_modules/execa/lib/error.js:59:11)
    at handlePromise (file:///home/runner/work/testing/testing/node_modules/semantic-release/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async default (file:///home/runner/work/testing/testing/node_modules/semantic-release/node_modules/@semantic-release/npm/lib/prepare.js:26:3)
    at async prepare (file:///home/runner/work/testing/testing/node_modules/semantic-release/node_modules/@semantic-release/npm/index.js:63:3)
    at async validator (file:///home/runner/work/testing/testing/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
    at async file:///home/runner/work/testing/testing/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
    at async Promise.all (index 0)
    at async next (file:///home/runner/work/testing/testing/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44) {
  shortMessage: 'Command failed with exit code 1: npm version 0.22.2 --userconfig /tmp/83437ffc97d16db8f71020513bd690ce/.npmrc --no-git-tag-version --allow-same-version',
  command: 'npm version 0.22.2 --userconfig /tmp/83437ffc97d16db8f71020513bd690ce/.npmrc --no-git-tag-version --allow-same-version',
  escapedCommand: 'npm version 0.22.2 --userconfig "/tmp/83437ffc97d16db8f71020513bd690ce/.npmrc" --no-git-tag-version --allow-same-version',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: 'v0.22.2',
  stderr: 'npm ERR! code ERR_INVALID_ARG_TYPE\n' +
    'npm ERR! The "from" argument must be of type string. Received undefined\n' +
    '\n' +
    'npm ERR! A complete log of this run can be found in:\n' +
    'npm ERR!     /home/runner/.npm/_logs/2023-07-31T05_33_03_943Z-debug-0.log',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false,
  pluginName: '@semantic-release/npm'
}

My release config:

module.exports = {
  branches: [
    { name: "main" }
  ],
  plugins: [
    [
      "@semantic-release/commit-analyzer",
      {
        preset: "conventionalCommits",
        parserOpts: {
          noteKeywords: [
            "BREAKING CHANGE",
            "BREAKING CHANGES",
            "BREAKING",
            "NEW RELEASE",
          ],
        },
        releaseRules: releaseRules,
      },
    ],
    [
      "@semantic-release/release-notes-generator",
      {
        preset: "conventionalCommits",
        parserOpts: {
          noteKeywords: [
            "BREAKING CHANGE",
            "BREAKING CHANGES",
            "BREAKING",
            "NEW RELEASE",
          ],
        },
        presetConfig: {
          types: notesTypes,
        },
      },
    ],
    [
      "@semantic-release/changelog",
      {
        changelogFile: "CHANGELOG.md",
      },
    ],
    [
      "@semantic-release/npm",
      {
        npmPublish: false,
      },
    ],
    [
      "@semantic-release/git",
      {
        assets: ["package.json", "CHANGELOG.md"],
        message:
          "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}",
      },
    ],
    [
      "@semantic-release/github",
      {
        assets: ["package.json", "CHANGELOG.md"],
        message:
          "chore(release): ${nextRelease.version} \n\n${nextRelease.notes}",
      },
    ],
  ],
}

Not able to update package.json version or possibly publish

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions