admin管理员组文章数量:1294010
I am using gulp in my application.
- installed gulp
- put the npm script
- 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 mand, 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
I am using gulp in my application.
- installed gulp
- put the npm script
- 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 mand, 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
Share Improve this question asked Oct 12, 2021 at 6:13 Ranjan SinghRanjan Singh 1351 gold badge2 silver badges13 bronze badges 2-
Try with
"./node_modules/.bin/gulp watch"
? – Jeremy Thille Commented Oct 12, 2021 at 6:25 - I tried it. but won't worked. Thank you – Ranjan Singh Commented Oct 12, 2021 at 12:15
2 Answers
Reset to default 9When 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"
}
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.
本文标签:
版权声明:本文标题:javascript - 'node_modules' is not recognized as an internal or external command, operable program or batch file 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741592003a2387183.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论