Probleme lancement d'un bot dicord sur Heroku

leoboeb79 -  
 leoboeb79 -
voila le message d'erreur dans la consol sur heroku, j'ai fait la commande "npm index.js" et j'ai eu ce resultat :

Usage: npm <command>

where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami

npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview

Specify configs in the ini-formatted file:
/app/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@6.14.11 /app/.heroku/node/lib/node_modules/npm

1 réponse

  1. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830
     
    Déjà... Bonjour ! ( si si .. on commence par ça ici ! )

    Ensuite, je ne fais pas de node ...
    mais une très rapide recherche sur le net me fait dire que :

    Tu dois avoir un fichier package.json
    Dans lequel doit se trouver
    "scripts": {
      "start": "node index.js"
    },
    

    et donc, que la bonne commande à lancer .. c'est tout simplement
     npm start


    1
    1. leoboeb79
       
      Bonjour, je vous fait parvenir mon code qui est dans le fichier package.json
      Je signale que j'ai deja fait un bot et il fonctionne correctement.
      Merci d'avance

      {
      "name": "welcom",
      "version": "2.0.0",
      "description": "",
      "main": "index.js",
      "dependencies": {
      "discord.js": "^12.5.1",
      "dotenv": "^8.2.0"
      },
      "devDependencies": {},
      "scripts": {
      "test": "echo \"Error: no test specified\" && exit 1"
      },
      "repository": {
      "type": "git",
      "url": "git+https://github.com/nfcpsnbourgeois/botdiscordeliot.git"
      },
      "author": "********",
      "license": "ISC",
      "bugs": {
      "url": "https://github.com/nfcpsnbourgeois/botdiscordeliot/issues"
      },
      "homepage": "https://github.com/nfcpsnbourgeois/botdiscordeliot#readme"
      }
      0