apexad / eufy-robovac

NodeJS library to control Eufy RoboVac
MIT License
59 stars 17 forks source link

Cannot find module './dist/index' #3

Closed jonnyrider closed 4 years ago

jonnyrider commented 4 years ago

Hi,

When I try to run this I get the following error:

Error: Cannot find module './dist/index'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/smart/eufy-robovac/demo.js:1:11)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! eufy-robovac@1.2.0 demo: `node demo.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the eufy-robovac@1.2.0 demo script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/smart/.npm/_logs/2020-01-06T14_53_32_709Z-debug.log

When I installed it, I got a warning saying that the fsevents optional dependency was skipped because I didn't have the right system, not sure if it is linked to this.

I'm using Ubuntu on an Intel NUC if that helps.

Thanks

gaoqi7 commented 4 years ago

This project is build as typescript, you should compile first. Just run "tsc" command under the project folder

apexad commented 4 years ago

tsc may work, but npm run build is the correct thing to run.