siegfriedgrimbeek / fastify-api

A blazing fast REST APIs with Node.js, MongoDB, Fastify and Swagger.
MIT License
165 stars 69 forks source link

window64 nodemon error #8

Open zhanghaifeng213 opened 5 years ago

zhanghaifeng213 commented 5 years ago

E:\zhf\work\test\test\study\node\fastify-api-clone\fastify-api>

fastify-api@1.0.0 start E:\zhf\work\test\test\study\node\fast tify-api ./node_modules/nodemon/bin/nodemon.js ./src/index.js

'.' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! fastify-api@1.0.0 start: ./node_modules/nodemon/bin/n ndex.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the fastify-api@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is like ging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\admin\AppData\Roaming\npm-cache_logs\201 050Z-debug.log

E:\zhf\work\test\test\study\node\fastify-api-clone\fastify-api>

tEgRaT commented 5 years ago

@zhanghaifeng213 do not run 'npm start' in windows powershell or cmd, run it in bash.

FrankCoyle commented 5 years ago

The same error happens in bash.

Install nodemon globally: npm install -g nodemon

And change your start script in the package.json file: "start": "nodemon ./src/index.js",

tEgRaT commented 5 years ago

For me, it works in bash. I believe the reason is the .js suffix is not a executable file extension for Windows cmd.

tonylisanti commented 4 years ago

this helped me: https://stackoverflow.com/questions/23243353/how-to-set-shell-for-npm-run-scripts-in-windows