candicerimba / adakerja-node-interview

0 stars 0 forks source link

sh: nodemon: command not found #1

Open haruelrovix opened 4 years ago

haruelrovix commented 4 years ago

Hi @candicerimba πŸ‘‹

I'm Havit from AdaKerja. Thanks for the submission.

I tried to clone the repo. Test is good βœ…

➜  adakerja-node-interview git:(master) npm test

> adakerja-node-interview@1.0.0 test adakerja-node-interview
> jest --detectOpenHandles

 PASS  tests/history.test.js
  Testing history controller
    Testing without existing data
      βœ“ Should initialise correctly (4ms)
      βœ“ Should create new user and new message if no data about them (12ms)
    Testing with existing example data
      βœ“ Should ask a brand new user its name. (3ms)
      βœ“ Should not ask the user their birthday if message sent was not text (5ms)
      βœ“ Should set the user's name and ask their birthday correctly (2ms)
      βœ“ Should keep asking for birthday if format is wrong or date is invalid (6ms)
      βœ“ Should set the user's birthday and ask their participation correctly (2ms)
      βœ“ Should keep asking for participation if unrecognized (3ms)
      βœ“ Should recognize quick replies for participation (3ms)
      βœ“ Should recognize text replies for participation and send them the correct date (4ms)

Test Suites: 1 passed, 1 total
Tests:       10 passed, 10 total
Snapshots:   0 total
Time:        2.497s
Ran all test suites.

However, when I tried to run it, I got the error ❌

➜  adakerja-node-interview git:(master) npm start

> adakerja-node-interview@1.0.0 start adakerja-node-interview
> nodemon transpiled/index.js

sh: nodemon: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! adakerja-node-interview@1.0.0 start: `nodemon transpiled/index.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the adakerja-node-interview@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Question

  1. What is this error?
  2. Could you please fix it?

Waiting for your reply.

Regards, Havit

candicerimba commented 4 years ago

Hi Haruel!

Nodemon is generally what I use so I don't have to restart node whenever I make a change. You can just install it with npm install -g nodemon, but I've also just changed the start script for it to use node instead of nodemon.

Thanks for reviewing my code!

Cheers, Candice