0

I have this in my package.json

script: {
    "myscript": "babel-node script.js"
}

In the terminal I do npm run myscript my-param. I'm able to get

my-param in script.js, I have this in script.js

const argv = require('yargs').argv
const { _ : [ my_param ] } = argv
console.log(my_param)

But if I chain my npm script like so

script: {
    "myscript": "babel-node script.js && node_modules/karma/bin/karma start karma.config.js"
}

Then I can't pass anything using npm run myscript.js script.js from the terminal anymore? I don't see my-param in the console.log

Yunyi Chang
  • 159
  • 1
  • 12

0 Answers0