discord / discord-example-app

Basic Discord app with examples
MIT License
515 stars 525 forks source link

Consider adding minimum node version to README #10

Closed seanwendt closed 1 year ago

seanwendt commented 1 year ago

Example App will not work on older versions of Node and minimum requirements aren't listed anywhere. User will face an error like

app.js:1
(function (exports, require, module, __filename, __dirname) { import 'dotenv/config';
                                                                     ^^^^^^^^^^^^^^^

SyntaxError: Unexpected string
    at new Script (vm.js:83:7)
    at createScript (vm.js:267:10)
    at Object.runInThisContext (vm.js:319:10)
    at Module._compile (internal/modules/cjs/loader.js:685:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:775:12)
    at startup (internal/bootstrap/node.js:300:19)

which will be cryptic for new users to get past. (tested on 11.2.0, resolved on 16.17)

swalker326 commented 1 year ago

Could do a PR to add an .nvmrc file, then nvm could take care of it for you.

.nvmrc
v12.13.0

nvm use would use the correct node version if installed, prompt the user to download/install it or probably throw some error if the user doesn't have nvm setup. Can also be used as a guide for which version a project is looking for.