WebReflection / archibold.io

archibold.io
ISC License
86 stars 14 forks source link

how does the benja module get installed? #13

Closed ubidefeo closed 4 years ago

ubidefeo commented 4 years ago

is it just manually copied or installed via npm during setup?

I found something to fix while snooping, it's the home path, which should now point to /home/alarm/app/node_modules. I guess it works anyway because of globalPaths

this.paths = function paths() {
    [
    // should be the same as '/home/benja/app/node_modules'
    process.cwd() + '/node_modules',
    // to be sure it's available via process.cwd()
    '/home/benja/app/node_modules'
    ].concat(
    // eventually defined by BenjaOS
        (process.env.NODE_PATH || '').split(':').filter(stringValue)
    ).forEach(
        append,
        require('module').globalPaths
    );
};
WebReflection commented 4 years ago

there is no benja module here, so I've just published v0.2 and created a repo here: https://github.com/WebReflection/benja-module

ubidefeo commented 4 years ago

there you go! thank you for pointing to this and closing the issue :)

WebReflection commented 4 years ago

P.S. it is possible that 0.2 doesn't work ... I need to test if process.env.HOME points at alarm user or something else ... like the npm one ... in latest case I might need to hard-code with alarm, let's hope that's not the case.

WebReflection commented 4 years ago

P.S.2 for the time being, I've used /home/alarm/app/node_modules instead

ubidefeo commented 4 years ago

you've been really doing a lot of work on BENJA lately, I'm very happy with it. Hope all my issues don't bother you too much :)

WebReflection commented 4 years ago

not at all ... it's that kind of project that once works properly you don't keep changing it ... and yet it's software, so it needs maintenance, which is fine.

right now both Pi3 and Pi4 (meaning Pi2 too) work as they used to, please let me know if you find anything else that's off, thanks.