admin管理员组文章数量:1336177
I'm using nodmeon version 1.9.1
on a Linux machine.
I'm running nodemon with: nodemon --watch ./build
where I have my index.js content in the build folder.
But when I run nodemon it keeps looking for index.js
file at the project's home folder hence it throws an error because it cannot find it there.
I tried to check nodemon --help for any better option but I don't see any and also wrote it in package.json file in scripts object it still throws the same error.
I've also tried to run it as nodemon --watch ./build/index.js
still throws the error.
Also, the index.js file only contains a console.log('hello world');
just to make sure, it's nodemon itself.
I'm using nodmeon version 1.9.1
on a Linux machine.
I'm running nodemon with: nodemon --watch ./build
where I have my index.js content in the build folder.
But when I run nodemon it keeps looking for index.js
file at the project's home folder hence it throws an error because it cannot find it there.
I tried to check nodemon --help for any better option but I don't see any and also wrote it in package.json file in scripts object it still throws the same error.
I've also tried to run it as nodemon --watch ./build/index.js
still throws the error.
Also, the index.js file only contains a console.log('hello world');
just to make sure, it's nodemon itself.
1 Answer
Reset to default 7Your use of --watch
is throwing nodemon off.
What you're telling nodemon is "run normally, and watch the directory ./build
". nodemon is looking for a parameter after --watch
and finds ./build
. It then looks for a script, finds none, and thus uses the default.
Nodemon watches by default so what you want to run is nodemon ./build
本文标签: javascriptnodemon Cannot find module 39pathtoprojecthomeindexjs39Stack Overflow
版权声明:本文标题:javascript - nodemon Cannot find module 'pathtoprojecthomeindex.js' - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742402316a2468130.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论