Node.JS Cannot find module 'discord.js' hatası

0.0_lucas

Centipat
Katılım
4 Eylül 2022
Mesajlar
238
Çözümler
4
Yer
Bursa
Daha fazla  
Sistem Özellikleri
İşlemci; i7 12700K
RAM; Kingston Fury Beast 32 GB 3200 MHz DDR4 CL16
Ana Kart; ASUS B660M - E D4 3600MHz
Ekran Kartı; RX6750XT 12GB
Sıvı Soğutucu; MSI MAG CORELIQUID P360 360 mm İşlemci Sıvı Soğutucu
Cinsiyet
Erkek
Meslek
Meslek Lisesi Yazılım Öğrencisi
Selam arkadaşlar. Discord bot kodları ile vesaire uğraşıyorum. Videoda gösterdiği gibi NPM install yazıyorum indikten sonra Node. Yazıyorum ama hata alıyorum. Biraz önce Node.JS'nin V21'ini kurdum yine aynı hata.

Error: Cannot find module 'discord.js'
Require stack:
- C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\beş.js
At module. _resolvefilename (node:internal/modules/cjs/loader:1144:15)
At module. _load (node:internal/modules/cjs/loader:985:27)
At module. Require (node:internal/modules/cjs/loader:1235:19)
At require (node:internal/modules/helpers:176:18)
At object.<anonymous> (C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\beş.js:1:115)
At module. _compile (node:internal/modules/cjs/loader:1376:14)
At Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
At module. Load (node:internal/modules/cjs/loader:1207:32)
At module. _load (node:internal/modules/cjs/loader:1023:12)
At function. Executeuserentrypoint [as runMain] (node:internal/modules/run_main:135:12) {
Code: 'module_not_found',
Requirestack: [
'C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\beş.js'
]
}

Node.js v21.2.0
 
Son düzenleyen: Moderatör:
Selam arkadaşlar. Discord bot kodları ile vesaire uğraşıyorum. Videoda gösterdiği gibi NPM install yazıyorum indikten sonra Node. Yazıyorum ama hata alıyorum. Biraz önce Node.JS'nin V21'ini kurdum yine aynı hata.

npm install discord.js yazmanız gerekiyor. Hazır altyapı ise npm install yazın. Size tavsiyem önerilen sürümünü kullanmaniz olacaktır.
 
Selam arkadaşlar. Discord bot kodları ile vesaire uğraşıyorum. Videoda gösterdiği gibi NPM install yazıyorum indikten sonra Node. Yazıyorum ama hata alıyorum. Biraz önce Node.JS'nin V21'ini kurdum yine aynı hata.

JavaScript:
npm install discord.js

Bunu yazın.
 
JavaScript:
npm install discord.js

Bunu yazın.
az önce denedim olmadı ama yüklerken ekran error ile doluyor

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '16.x' },
npm WARN EBADENGINE current: { node: 'v21.2.0', npm: '10.2.3' }
npm WARN EBADENGINE }
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup 'C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\discord.js',
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\discord.js\node_modules\discord-api-types\payloads\v9\_interactions'] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: 'EPERM',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: 'C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\discord.js\\node_modules\\discord-api-types\\payloads\\v9\\_interactions'
npm WARN cleanup }
npm WARN cleanup ],
npm WARN cleanup [
npm WARN cleanup 'C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\@discordjs\\rest',
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\@discordjs\rest\node_modules\discord-api-types\payloads\v8'] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: 'EPERM',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: 'C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\@discordjs\\rest\\node_modules\\discord-api-types\\payloads\\v8'
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\canvas
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build --update-binary
npm ERR! Warning: Missing input files:
npm ERR! C:\GTK\bin\libexpat-1.dll
npm ERR! C:\GTK\bin\libfontconfig-1.dll
npm ERR! C:\GTK\bin\libpangowin32-1.0-0.dll
npm ERR! C:\GTK\bin\libgthread-2.0-0.dll
npm ERR! C:\GTK\bin\libglib-2.0-0.dll
npm ERR! C:\GTK\bin\libpangoft2-1.0-0.dll
npm ERR! C:\GTK\bin\libpango-1.0-0.dll
npm ERR! C:\GTK\bin\libfreetype-6.dll
npm ERR! C:\GTK\bin\libgmodule-2.0-0.dll
npm ERR! C:\GTK\bin\libcairo-2.dll
npm ERR! C:\GTK\bin\libgobject-2.0-0.dll
npm ERR! C:\GTK\bin\libintl-8.dll
npm ERR! C:\GTK\bin\libpangocairo-1.0-0.dll
npm ERR! C:\GTK\bin\libpng14-14.dll
npm ERR! C:\GTK\bin\zlib1.dll
npm ERR!
npm ERR! Backend.cc
npm ERR! C:\Users\prens\OneDrive\Masa�st�\Discord-ADESA\kayit-bot-code\node_modules\canvas\src\backend\Backend.h(3,10): fatal error C1083: i�erme dosyas� a��lam�yor: 'cairo.h': No such file or directory [C:\Users\prens\OneDrive\Masa�st�\Discord-ADESA\kayit-bot-code\node_modules\canvas\build\canvas.vcxproj]
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --update-binary --module=C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\canvas\build\Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v120' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | win32 | x64
npm ERR! (node:17472) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-...as-v2.11.2-node-v120-win32-unknown-x64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-...as-v2.11.2-node-v120-win32-unknown-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v120 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-...as-v2.11.2-node-v120-win32-unknown-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.11.5 found at "C:\Users\prens\AppData\Local\Programs\Python\Python311\python.exe"
npm ERR! gyp info find VS using VS2022 (17.7.34202.233) found at:
npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\prens\AppData\Local\Programs\Python\Python311\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\canvas\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\prens\\AppData\\Local\\node-gyp\\Cache\\21.2.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\prens\\AppData\\Local\\node-gyp\\Cache\\21.2.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\prens\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\21.2.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\canvas',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\canvas\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build\\binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:209:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:519:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--update-binary" "--module=C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\canvas\\build\\Release" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v120"
npm ERR! gyp ERR! cwd C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\canvas
npm ERR! gyp ERR! node -v v21.2.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --update-binary --module=C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\canvas\build\Release --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v120' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:519:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1105:16)
npm ERR! node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.22621
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\prens\\OneDrive\\Masaüstü\\Discord-ADESA\\kayit-bot-code\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
npm ERR! node-pre-gyp ERR! cwd C:\Users\prens\OneDrive\Masaüstü\Discord-ADESA\kayit-bot-code\node_modules\canvas
npm ERR! node-pre-gyp ERR! node -v v21.2.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:\Users\prens\AppData\Local\npm-cache\_logs\2023-11-16T10_13_26_471Z-debug-0.log

npm install discord.js yazmanız gerekiyor. Hazır altyapı ise npm install yazın. Size tavsiyem önerilen sürümünü kullanmaniz olacaktır.

Videodaki arkadaşın önerdiği sürüm V16 ve üstü ve bot V14.
 
Az önce denedim olmadı ama yüklerken ekran error ile doluyor.

Videodaki arkadaşın önerdiği sürüm V16 ve üstü ve bot v14.

Node.js'yi bilgisayarınızdan kaldırın. Daha sonra Node.js'nin recommended (önerilen) sürümünü indirin, kurun.

Videodaki arkadaşın önerdiği sürüm V16 ve üstü ve bot v14.

Tamam hocam, recommended (önerilen) versiyon yeterli olacaktır.
 
Node.js'yi bilgisayarınızdan kaldırın. Daha sonra Node.js'nin recommended (önerilen) sürümünü indirin, kurun.



Tamam hocam, recommended (önerilen) versiyon yeterli olacaktır.
Oldu sağol.

Node.js'yi bilgisayarınızdan kaldırın. Daha sonra Node.js'nin recommended (önerilen) sürümünü indirin, kurun.



Tamam hocam, recommended (önerilen) versiyon yeterli olacaktır.Tekrar bozuldu hocam olmadı.

Node.js'yi bilgisayarınızdan kaldırın. Daha sonra Node.js'nin recommended (önerilen) sürümünü indirin, kurun.



Tamam hocam, recommended (önerilen) versiyon yeterli olacaktır.
Tekrar hata veriyor hoca molmuyor.
 
Son düzenleme:

Dosya Ekleri

  • 123456789.png
    123456789.png
    53,1 KB · Görüntüleme: 58

Yeni konular

Geri
Yukarı