wschenk / tradfri-cli

cli scripts to control tradfri internet gateway
https://willschenk.com/articles/2019/controlling_ikea_tradfri_with_node
24 stars 3 forks source link

Can not use script with absolute path #18

Closed florianpasteur closed 2 years ago

florianpasteur commented 2 years ago

Hello,

It's not possible to execute the javascript files outside the project directory, for example with the absolute path of the script.

(Wed Dec-12 4:31:57pm)-(pi@octoprint:/)-
> node /home/pi/tradfri-cli/bin/devices.js
/home/pi/tradfri-cli/node_modules/conf/index.js:58
                throw new Error('Project name could not be inferred. Please specify the `projectName` option.');
                ^

Error: Project name could not be inferred. Please specify the `projectName` option.
    at new Conf (/home/pi/tradfri-cli/node_modules/conf/index.js:58:11)
    at Object.<anonymous> (/home/pi/tradfri-cli/bin/connection.js:11:14)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/home/pi/tradfri-cli/bin/devices.js:7:22)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)

KR.