RangerMauve / dat-store

A CLI tool for backing up hyperdrive datasets
GNU Affero General Public License v3.0
59 stars 14 forks source link

difficulties with node 11 #49

Closed ameba23 closed 3 years ago

ameba23 commented 3 years ago

using node version 10.23.0 this works great for me.

but with node 11.15.0 i get the following error when starting the service.

kale ~ $ dat-store run-service
/home/kale/.nvm/versions/node/v11.15.0/lib/node_modules/dat-store/node_modules/yargs/yargs.js:1172
      else throw err
           ^

ReferenceError: globalThis is not defined
    at Object.<anonymous> (/home/kale/.nvm/versions/node/v11.15.0/lib/node_modules/dat-store/node_modules/queue-microtask/index.js:5:25)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/home/kale/.nvm/versions/node/v11.15.0/lib/node_modules/dat-store/node_modules/avvio/plugin.js:3:24)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
RangerMauve commented 3 years ago

Thanks for the report, I've been using node 12 so I hadn't come across this.

Does updating the yargs dependency help? Try cloning the repo, running npm i --save yargs@latest and running ./bin run-service

ameba23 commented 3 years ago

strangely, no that doesn't seem to help.

it bumps yargs from 13.2.2 to 16.2.0, but the same error is still getting thrown. maybe this is an issue for yargs. although searching yargs' 248 open issues for 'globalThis' didnt give any results.

also working fine for me with node 12 so maybe this is not such a big problem.

RangerMauve commented 3 years ago

Hmm, I'm going to close this for now and suggest folks use a newer node version, but I'm open to PRs for a fix if somebody comes up with one. 😅