npm icon indicating copy to clipboard operation
npm copied to clipboard

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

Open CalicoNino opened this issue 2 years ago • 2 comments

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

CalicoNino avatar Jul 31 '23 05:07 CalicoNino

Hey, I have a similar issue, but without any message on stderr :shrug: . I've tried to force the resolution to v10.0.3, which worked in the past, but it continues to fail. We are using GitHub actions, I believe something has changed there. Do you use another CI?

Error: Command failed with exit code 1: npm version 2.2.10 --userconfig /tmp/b6dff767e03d5f1bd7031f71304dbeb2/.npmrc --no-git-tag-version --allow-same-version
    at makeError (file:///home/runner/work/renderscript/renderscript/node_modules/execa/lib/error.js:60:11)
    at handlePromise (file:///home/runner/work/renderscript/renderscript/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async default (file:///home/runner/work/renderscript/renderscript/node_modules/@semantic-release/npm/lib/prepare.js:26:3)
    at async prepare (file:///home/runner/work/renderscript/renderscript/node_modules/@semantic-release/npm/index.js:63:3)
    at async validator (file:///home/runner/work/renderscript/renderscript/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
    at async file:///home/runner/work/renderscript/renderscript/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
    at async Promise.all (index 0)
    at async next (file:///home/runner/work/renderscript/renderscript/node_modules/p-reduce/index.js:15:44) {
  shortMessage: 'Command failed with exit code 1: npm version 2.2.10 --userconfig /tmp/b6dff767e03d5f1bd7031f71304dbeb2/.npmrc --no-git-tag-version --allow-same-version',
  command: 'npm version 2.2.10 --userconfig /tmp/b6dff767e03d5f1bd7031f71304dbeb2/.npmrc --no-git-tag-version --allow-same-version',
  escapedCommand: 'npm version 2.2.10 --userconfig "/tmp/b6dff767e03d5f1bd7031f71304dbeb2/.npmrc" --no-git-tag-version --allow-same-version',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '',
  cwd: '/home/runner/work/renderscript/renderscript',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false,
  pluginName: '@semantic-release/npm'

sbellone avatar Aug 07 '23 12:08 sbellone

I am running it via github workflows, also I was able to resolve the issue by downgrading @semantic-release/npm to v9.0.0, but now I am facing a new error :upside_down_face:

npm ERR! Minipass.isStream is not a function

CalicoNino avatar Aug 16 '23 06:08 CalicoNino