#javascript #node.js #npm #terminal #discord.js
#javascript #node.js #npm #терминал #discord.js
Вопрос:
Я пытаюсь закодировать Discord-бота, который может позволить людям играть в шахматы. Я закончил писать исходный код и почти уверен, что в нем нет синтаксических ошибок (я проверил через онлайн- js
средства проверки). В терминале я запустил команду npm install node app.js
. Я получил следующее массивное сообщение ниже. В результате, когда я node app.js
подключил своего бота к Сети и выполнил надлежащие действия, это не удалось.
Ошибка:
npm WARN deprecated express@2.5.9: express 2.x series is deprecated
npm WARN deprecated connect@1.9.2: connect 1.x series is deprecated
npm WARN deprecated mkdirp@0.3.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/contextify/src/contextify.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/daniel/Desktop/discord bot/node_modules/node/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/daniel/Desktop/discord bot/node_modules/contextify
gyp ERR! node -v v14.8.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN notsup Unsupported engine for express@2.5.9: wanted: {"node":">= 0.4.1 < 0.7.0"} (current: {"node":"14.8.0","npm":"6.14.7"})
npm WARN notsup Not compatible with your version of node/npm: express@2.5.9
npm WARN discord.js@11.3.2 requires a peer of bufferutil@^3.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.2 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.2 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.2 requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.2 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.2 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.3.2 requires a peer of uws@^9.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN chessbot@0.0.1 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! contextify@0.1.15 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the contextify@0.1.15 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/daniel/.npm/_logs/2020-08-21T20_14_21_590Z-debug.log
Комментарии:
1. между первым блоком предупреждений и сообщением «fatal error» также было довольно много текста. если это поможет, я могу отправить его 🙂
2. Я подозреваю, что у вас действительно очень старая версия discord.js . В журнале ошибок указано, что для этого требуется node версии 0.7 tops. Если вы проверите страницу проекта на github, для этого требуется 12: github.com/discordjs/discord.js/blob/master/package.json