'.' is not recognized as an internal or external command in running script in npm

Viewed 3778

In package.json file:

"scripts": {    

   "dev": "./scripts/dev_parallel.sh",

}

I am trying to run a shell script by typing in:

npm run dev 

But I am getting following error:-

$ npm run dev

 ./scripts/dev_parallel.sh

'.' is not recognized as an internal or external command, operable program or batch file.
1 Answers

change '.' with '%INIT_CWD%' on windows.

Before:

"scripts": {
    "build": "./node_modules/.bin/drupal-gutenberg-translations && ./node_modules/.bin/drupal-js-build --css"
},

After:

"scripts": {
    "build": "%INIT_CWD%/node_modules/.bin/drupal-gutenberg-translations && %INIT_CWD%/node_modules/.bin/drupal-js-build --css"
},
Related