daaru00 / aws-iot-example

AWS IoT Sensors Example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run "npm run motion.js"

LogicLuminaryy opened this issue · comments

Hi
I am trying to run npm run motion.js after providing all credentials but I am getting error
nkitkumar@ankitkumar-VPCEH36EN:~/Desktop/aws-iot-example$ npm start
...................................................................................................................................
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ankitkumar/.npm/_logs/2018-05-25T06_32_32_192Z-debug.log
ankitkumar@ankitkumar-VPCEH36EN:~/Desktop/aws-iot-example$ npm run build
npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:

Hi @inconsolableanki

I cannot understand well.. seems you are using wrong npm scripts command

Unable to run "npm run motion.js" #1

is not correct, the correct command is

npm run motion

without ".js" extension, it doesn't run a file, it run an npm script.

nkitkumar@ankitkumar-VPCEH36EN:~/Desktop/aws-iot-example$ npm start

ankitkumar@ankitkumar-VPCEH36EN:~/Desktop/aws-iot-example$ npm run build

These commands are not defined and not mentioned in the README.md. Neither "start" nor "build" are defined in the package.json and its are not needed.

Please refer to npm documentation about scripts.

Anyway, to run the "motion" script run

npm run motion

or

node ./tasks/motion.js

or use PM2 to run all the scripts.