EQuimper / nodejs-api-boilerplate

A boilerplate for kickstart your nodejs api project with JWT Auth and some new Techs :)
MIT License
464 stars 121 forks source link

Can't start the project in DEV after following getting-started instructions #111

Open javaallah opened 6 years ago

javaallah commented 6 years ago

Cloned the project. Did yarn install created .env Mongo runs

I do yarn dev and get this:

nodejs-jwt-mongo-api-boilerplate git:(master) ✗ yarn dev yarn run v1.10.1 $ nps dev nps is executingdev: node node_modules/concurrently/src/main.js --kill-others-on-fail --prefix-colors "bgBlue.bold,bgMagenta.bold" --prefix "[{name}]" --names "dev.watch,dev.start" 'nps dev.watch' 'nps dev.start' [dev.start] nps is executingdev.start: node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development nodemon dist/index.bundle.js [dev.watch] nps is executingdev.watch: webpack -w [dev.start] events.js:165 [dev.start] throw er; // Unhandled 'error' event [dev.start] ^ [dev.start] [dev.start] Error: spawn nodemon ENOENT [dev.start] at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19) [dev.start] at onErrorNT (internal/child_process.js:379:16) [dev.start] at process._tickCallback (internal/process/next_tick.js:178:19) [dev.start] at Function.Module.runMain (internal/modules/cjs/loader.js:697:11) [dev.start] at startup (internal/bootstrap/node.js:201:19) [dev.start] at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3) [dev.start] Emitted 'error' event at: [dev.start] at Process.ChildProcess._handle.onexit (internal/child_process.js:207:12) [dev.start] at onErrorNT (internal/child_process.js:379:16) [dev.start] [... lines matching original stack trace ...] [dev.start] at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3) [dev.start] The script called "dev.start" which runs "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development nodemon dist/index.bundle.js" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.9.3/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code [dev.start] nps dev.start exited with code 1 --> Sending SIGTERM to other processes.. [dev.watch] nps dev.watch exited with code null The script called "dev" which runs "node node_modules/concurrently/src/main.js --kill-others-on-fail --prefix-colors "bgBlue.bold,bgMagenta.bold" --prefix "[{name}]" --names "dev.watch,dev.start" 'nps dev.watch' 'nps dev.start'" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.9.3/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

fabriciofrontarolli commented 6 years ago

I had some problems when first running it. I ran the 2 commands and it worked for me

npm run build - to generate the dist folder and transpile the code npm run dev - to startup node server using the /dist/index.bundle.js