Skip to content

[BUG] startNewVersion script fails on Windows due to Unix shell syntax #609

@Soumya-codr

Description

@Soumya-codr

Describe the bug.

Summary
The startNewVersion npm script fails completely on Windows because it uses Unix-specific environment variable syntax that Windows CMD doesn't understand.

Current Problematic Code
File: package.json (line 13)

```json
`"startNewVersion": "newVersion=$npm_config_new_version node scripts/add-new-version.js"`

Problem

  • newVersion=$npm_config_new_version is Unix shell syntax
  • Windows CMD doesn't recognize variable=value format
  • Results in: 'newVersion' is not recognized as an internal or external command

Error Output

npm run startNewVersion
'newVersion' is not recognized as an internal or external command,
operable program or batch file.

Expected behavior

Steps to Reproduce:

  1. Use a Windows machine (Windows 10/11)
  2. Clone the repository: git clone https://github.com/asyncapi/spec-json-schemas.git
  3. Navigate to directory: cd spec-json-schemas
  4. Install dependencies: npm install
  5. Try to run the script: npm run startNewVersion --new-version=2.7.0
  6. Observe the error

Alternative reproduction:

  • Simply run: npm run startNewVersion
  • Same error occurs immediately

What happens:
Windows CMD tries to parse the Unix syntax and fails at newVersion= because Windows doesn't understand Unix variable assignment syntax.

Screenshots

Image

How to Reproduce

Steps to Reproduce

  1. Use a Windows machine (Windows 10/11)
  2. Clone the repository: git clone https://github.com/asyncapi/spec-json-schemas.git
  3. Navigate to directory: cd spec-json-schemas
  4. Install dependencies: npm install
  5. Try to run the script: npm run startNewVersion --new-version=2.7.0
  6. Observe the error

Alternative reproduction (without version flag):

  1. Simply run: npm run startNewVersion
  2. Same error occurs immediately

What happens:

  • Windows CMD tries to parse: newVersion=$npm_config_new_version node scripts/add-new-version.js
  • Fails at newVersion= because Windows doesn't understand Unix variable assignment syntax
  • Script never gets executed

🖥️ Device Information [optional]

  • Operating System:
  • Browser:
  • Browser Version:

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions