Can't get example to run
colinrblake opened this issue · comments
Forgive this simple question as I've never used node.js before, but how do I run the example? I've downloaded the package as a zip file, expanded it, and edited example.js to use my systemName and password. But trying to run the example:
node-screenlogic$ node example.js
/Users/colin/node.js/node-screenlogic/index.js:21
var remote = new ScreenLogic.RemoteLogin(systemName);
^
TypeError: ScreenLogic.RemoteLogin is not a constructor
at Object.<anonymous> (/Users/colin/node.js/node-screenlogic/index.js:21:14)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/colin/node.js/node-screenlogic/example.js:3:21)
at Module._compile (internal/modules/cjs/loader.js:701:30)
node-screenlogic$
node-screenlogic$ node -v
v10.15.3
node-screenlogic$
$ git clone https://github.com/parnic/node-screenlogic.git
Cloning into 'node-screenlogic'...
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 195 (delta 10), reused 16 (delta 5), pack-reused 174
Receiving objects: 100% (195/195), 59.39 KiB | 1.70 MiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd node-screenlogic/
$ npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
added 142 packages from 568 contributors and audited 235 packages in 1.834s
found 0 vulnerabilities
$ node example
no unit found by that name
and if I set my system name/password correctly, it works. Tried with Node v8.16.0 and v10.15.3. Not sure what to suggest. You sure all the right files (namely index.js
) are there? Example includes everything in index.js
under the name ScreenLogic
, then index defines a class RemoteLogin
which has a constructor.
Tried the "git clone" way and it worked fine. Not sure why the download didn't.
Thanks for your help.