Discord.js: I can't Install Discord.js

Created on 27 Dec 2015  路  5Comments  路  Source: discordjs/discord.js

//Sorry for my English i am French

The server said:
npm WARN ENOENT ENOENT: no such file or directory, open '/root/package.json'
npm WARN EPACKAGEJSON root No description
npm WARN EPACKAGEJSON root No repository field.
npm WARN EPACKAGEJSON root No README data
npm WARN EPACKAGEJSON root No license field.

http://i.imgur.com/G4QxK3a.png

question (please use Discord instead)

Most helpful comment

@rogafe Do npm init and follow the steps and fill in the information for your bot.
Then do npm i --save discord.js --no-optional after completing all the steps.

The warnings are because NPM is failing to find a package.json file where you are attempting to install the library. The first command will create that file for you using the information you give it. The second command installs the library, like you have already done, but with the --save flag which will add it to the file created in the first step.

As @abalabahaha said above, the library is installing fine but NPM is warning you that it failed to find a package.json file and thus also can't find the 4 fields in the other warnings which are soft-requirements for all public packages. You could technically use the library as it is installed now, but any time you go to install another package NPM will spit out the same warnings until you have fixed it.

All 5 comments

Just to make sure, you are running this in the root directory of the bot and it contains a package.json file right?
image

Notice the "WARN". It's a warning, but it does not break your installation. Your installation should be fine,

@rogafe Do npm init and follow the steps and fill in the information for your bot.
Then do npm i --save discord.js --no-optional after completing all the steps.

The warnings are because NPM is failing to find a package.json file where you are attempting to install the library. The first command will create that file for you using the information you give it. The second command installs the library, like you have already done, but with the --save flag which will add it to the file created in the first step.

As @abalabahaha said above, the library is installing fine but NPM is warning you that it failed to find a package.json file and thus also can't find the 4 fields in the other warnings which are soft-requirements for all public packages. You could technically use the library as it is installed now, but any time you go to install another package NPM will spit out the same warnings until you have fixed it.

Thank you all for your reply, I reinstate the server and everything works
Thanks Rogafe

I'm having issues installing discord.js too. It gives me the same warnings. I tried to use npm init and the other command from Seph but it gives me an error saying "no capital letter can be used" even though there arent caps in it. help pls.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vladfrangu picture vladfrangu  路  23Comments

godleydemon picture godleydemon  路  23Comments

tandpfun picture tandpfun  路  27Comments

Koyamie picture Koyamie  路  42Comments

ericnelson0 picture ericnelson0  路  62Comments