3

I am using gulp in my application.

  1. installed gulp
  2. put the npm script
  3. run the script by using "npm start"

Got the error:- **> start

node_modules/.bin/gulp watch 'node_modules' is not recognized as an internal or external command, operable program or batch file.**

In package.json to start the script:- "scripts": { "start": "node_modules/.bin/gulp watch" },

Kindly help me to fix this issue. Thank you

Ranjan Singh
  • 123
  • 2
  • 9

2 Answers2

9

When working with npm packages you do not need to specify a path to executable in node_modules. Try the following setup:

  "scripts": {
    "start": "gulp watch"
  },

Make sure that gulp is present in dependencies as well.

  "dependencies": {
    "gulp": "^4.0.2"
  }
Olek Oliynyk
  • 136
  • 3
0

I also ran into this problem while working on React/NextJs project. The way I solved it is by specifying a direct path for the scripts in the package.json folder as follows:

"scripts": {
"dev": "C:/Users/username/myFolder/NextjsProjectFolder/node_modules/.bin/next dev",
"build": "C:/Users/username/myFolder/NextjsProjectFolder/node_modules/.bin/next build",
"start": "C:/Users/username/myFolder/NextjsProjectFolder/node_modules/.bin/next start",

},

Perhaps, this could be helpful to someone working on Nextjs project.

Martin Oputa
  • 349
  • 4
  • 6