Skip to content

Conversation

JatinShimpi
Copy link

…the build and start commands

Description

in the editPackageJsonName function inside the packages\botonic-cli\src\util\download-gzip.ts directory added functionality so that the projects package.json file comes with cross-env which should fix this error

Context

this should prevent the error when the user starts or builds the project

Approach taken / Explain the design

simply added one function

 jsonData.devDependencies = {
    ...jsonData.devDependencies,
    'cross-env': '^7.0.3',
  }

  // Prefix `build` and `start` with cross-env
  const scripts = jsonData.scripts || {}
  for (const scriptName of ['build', 'start']) {
    if (scripts[scriptName] && !scripts[scriptName].startsWith('cross-env')) {
      scripts[scriptName] = `cross-env ${scripts[scriptName]}`
    }
  }
  jsonData.scripts = scripts

To document / Usage example

Testing

The pull request...

  • has unit tests
  • has integration tests
  • doesn't need tests because... [provide a description]

@vanbasten17
Copy link
Contributor

hi @JatinShimpi , thanks for your contribution! Just to be sure, which is the step you are trying to solve with this? Did you experience some kind of error on installation or do you need this dependency for your development?

@JatinShimpi
Copy link
Author

i expereinced error on installation "ENVIRONMENT not recognized"

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

Successfully merging this pull request may close these issues.

2 participants