NPM install hatası nasıl çözülür?

lactarius06

Decapat
Katılım
14 Nisan 2023
Mesajlar
47
Çözümler
1
Daha fazla  
Sistem Özellikleri
MSİ B460M Pro, İntel Core İ3 10100F, Nvidia Geforce GTX 1660S, 16 GB DDR4, Kioxia 500GB Exceria G2 NVMe M.2 SSD, 500 GB Samsung SATA SSD.
Cinsiyet
Erkek
Meslek
Öğrenci
Discord botu yapmak istiyorum ancak NPM install komutunu kullandığımda aşağıdaki hatayı veriyor. Node.js kurulu bunu nasıl çözebilirim?

"npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

    • npm init -y
    • ~~~
+ CategoryInfo : SecurityError: :)) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess"
 
Son düzenleyen: Moderatör:
Discord botu yapmak istiyorum ancak NPM install komutunu kullandığımda aşağıdaki hatayı veriyor. Node.js kurulu bunu nasıl çözebilirim?

"NPM: File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this System. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line: 1 char: 1


    • NPM init -y
    • ~~~
+ CategoryInfo: SecurityError: :)) [], PSSecurityException
+ FullyQualifiedErrorId: UnauthorizedAccess"

PowerShell'i yönetici şekilde çalıştırın ve şunu yazın:
Set-ExecutionPolicy RemoteSigned

Sonrasında Y yazıp enterlayın.
 
PowerShell'i yönetici şekilde çalıştırın ve şunu yazın:
Set-ExecutionPolicy RemoteSigned

Sonrasında Y yazıp enterlayın.
hocam dediğinizi yaptım sonra tekrardan dosyada npm init -y ve ardından npm instal yaptım ardından baya bi hata verdi

npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated @discordjs/[email protected]: no longer supported
npm warn deprecated @discordjs/[email protected]: Package no longer supported. Contact Support at @midwayjs/view-ejs for more info.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated @discordjs/[email protected]: no longer supported
npm warn deprecated [email protected]: no longer supported
npm warn deprecated @discordjs/[email protected]: no longer supported
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup '\\\\?\\C:\\Users\\tahak\\Desktop\\ay elcan\\node_modules',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\tahak\Desktop\ay elcan\node_modules\discord.js\node_modules\@discordjs\opus\deps\opus\silk'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\\Users\\tahak\\Desktop\\ay elcan\\node_modules\\discord.js\\node_modules\\@discordjs\\opus\\deps\\opus\\silk'
npm warn cleanup }
npm warn cleanup ],
npm warn cleanup [
npm warn cleanup '\\\\?\\C:\\Users\\tahak\\Desktop\\ay elcan\\node_modules\\discord.js',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\tahak\Desktop\ay elcan\node_modules\discord.js\node_modules\@discordjs'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\\Users\\tahak\\Desktop\\ay elcan\\node_modules\\discord.js\\node_modules\\@discordjs'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
npm error code 1
npm error path C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\opus
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm error Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\tahak\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\opus\prebuild\node-v127-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\opus\prebuild\node-v127-napi-v3-win32-x64-unknown-unknown --napi_version=10 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm error node-pre-gyp info it worked if it ends with ok
npm error node-pre-gyp info using [email protected]
npm error node-pre-gyp info using [email protected] | win32 | x64
npm error node-pre-gyp WARN Using needle for node-pre-gyp https download
npm error node-pre-gyp info check checked for "C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\opus\prebuild\node-v127-napi-v3-win32-x64-unknown-unknown\opus.node" (not found)
npm error node-pre-gyp http GET https://github.com/discordjs/opus/r...v127-napi-v3-win32-x64-unknown-unknown.tar.gz
npm error node-pre-gyp http 404 https://github.com/discordjs/opus/r...v127-napi-v3-win32-x64-unknown-unknown.tar.gz
npm error node-pre-gyp WARN Tried to download(404): https://github.com/discordjs/opus/r...v127-napi-v3-win32-x64-unknown-unknown.tar.gz
npm error node-pre-gyp WARN Pre-built binaries not found for @discordjs/[email protected] and [email protected] (node-v127 ABI, unknown) (falling back to source compile with node-gyp)
npm error node-pre-gyp http 404 status code downloading tarball https://github.com/discordjs/opus/r...v127-napi-v3-win32-x64-unknown-unknown.tar.gz
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | win32 | x64
npm error gyp info ok
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | win32 | x64
npm error gyp info find Python using Python version 3.10.11 found at "C:\Users\tahak\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm error gyp ERR! find VS
npm error gyp ERR! find VS msvs_version not set from command line or npm config
npm error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2015 as it is only supported up to Node.js 18
npm error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm error gyp ERR! find VS
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS You need to install the latest version of Visual Studio
npm error gyp ERR! find VS including the "Desktop development with C++" workload.
npm error gyp ERR! find VS For more information consult the documentation at:
npm error gyp ERR! find VS GitHub - nodejs/node-gyp: Node.js native addon build tool
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm error gyp ERR! stack at VisualStudioFinder.fail (C:\Users\tahak\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:118:11)
npm error gyp ERR! stack at VisualStudioFinder.findVisualStudio (C:\Users\tahak\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:17)
npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
npm error gyp ERR! stack at async createBuildDir (C:\Users\tahak\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:112:18)
npm error gyp ERR! stack at async run (C:\Users\tahak\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js:81:18)
npm error gyp ERR! System Windows_NT 10.0.19045
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\tahak\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\tahak\\Desktop\\ay elcan\\node_modules\\@discordjs\\opus\\prebuild\\node-v127-napi-v3-win32-x64-unknown-unknown\\opus.node" "--module_name=opus" "--module_path=C:\\Users\\tahak\\Desktop\\ay elcan\\node_modules\\@discordjs\\opus\\prebuild\\node-v127-napi-v3-win32-x64-unknown-unknown" "--napi_version=10" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm error gyp ERR! cwd C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\opus
npm error gyp ERR! node -v v22.16.0
npm error gyp ERR! node-gyp -v v11.2.0
npm error gyp ERR! not ok
npm error node-pre-gyp ERR! build error
npm error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\tahak\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\opus\prebuild\node-v127-napi-v3-win32-x64-unknown-unknown\opus.node --module_name=opus --module_path=C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\opus\prebuild\node-v127-napi-v3-win32-x64-unknown-unknown --napi_version=10 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm error node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\node-pre-gyp\lib\util\compile.js:72:20)
npm error node-pre-gyp ERR! stack at ChildProcess.emit (node:events:518:28)
npm error node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1101:16)
npm error node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm error node-pre-gyp ERR! System Windows_NT 10.0.19045
npm error node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\tahak\\Desktop\\ay elcan\\node_modules\\@discordjs\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm error node-pre-gyp ERR! cwd C:\Users\tahak\Desktop\ay elcan\node_modules\@discordjs\opus
npm error node-pre-gyp ERR! node -v v22.16.0
npm error node-pre-gyp ERR! node-pre-gyp -v v0.1.0
npm error node-pre-gyp ERR! not ok
npm error A complete log of this run can be found in: C:\Users\tahak\AppData\Local\npm-cache\_logs\2025-06-12T12_14_36_360Z-debug-0.log
 
VS yuklemen gerekiyor?

Windows sistemde npm kullanmak icin neden VS kullanmak zorunda birakildigini ben de bilmiyorum, Windows'da node kullanan developer'larin belki makul bir aciklamasi vardir.
 
Vs yuklemen gerekiyor?

Windows sistemde NPM kullanmak icin neden vs kullanmak zorunda birakildigini ben de bilmiyorum, Windows'ta Node kullanan Developer'larin belki makul bir aciklamasi vardir.

Vallahi bende bot kodlardim 3 sene önce Discord. Jsv12 vardı o zamanlar NPM init yazardım başlardım botu kodlamaya.
 
VS yuklemen gerekiyor?

Windows sistemde npm kullanmak icin neden VS kullanmak zorunda birakildigini ben de bilmiyorum, Windows'da node kullanan developer'larin belki makul bir aciklamasi vardir.
vs yüklü zaten hatayı anlamış değilim ne denediysem düzelmedi
 

Technopat Haberler

Geri
Yukarı