Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.
like image 302
Harsh Aggarwal Avatar asked Oct 18 '22 08:10

Harsh Aggarwal


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"
},
like image 98
Flyke Avatar answered Oct 21 '22 08:10

Flyke