Npm – die neusten Beiträge

Node JS / Npm Fehlermeldung?

Ich wollte Robot JS installieren mit Windows (Unter Linux klappt alles super )

jedoch tritt diese Fehlermeldung auf und ich habe schon viel versucht.

Nichts hilft. https://pastebin.com/1VfKGnXx

Habe auch beim installieren von NodeJS darauf geachtet das es diese Python/C++ Pakete oder so mit installiert.

PS C:\Users\maxmustermann\Desktop\robotjs> npm install robotjs

Es installiert kurz Robot Js und dann löscht es sich wieder und dann erscheint das

Part 1:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code 1
npm ERR! path C:\Users\maxmustermann\Desktop\robotjs\node_modules\robotjs
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@18.3.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.5 found at "C:\Users\maxmustermann\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2022 (17.2.32602.215) found at:
npm ERR! gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - missing any VC++ toolset
npm ERR! gyp ERR! find VS checking VS2019 (16.11.32602.291) found at:
npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - missing any VC++ toolset
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS

Die ganze Fehlermeldung passt hier nicht rein.

PC, Computer, Software, Technik, programmieren, JavaScript, Informatik, npm

NPM auf RaspberryPi geht nicht?

Guten Tag,

ich nutze viel NodeJS, leider kann ich auf meinem RaspberriPi kein npm nutzen, ich muss daher alles auf meinem PC installieren und dann inklusive node module hochladen. Wie fix ich NPM? Fehler:

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/agent.js:114:44)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/socks-proxy-agent/dist/index.js:5:33)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/make-fetch-happen/lib/agent.js:161:25)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)

 
Computer, Technik, Installation, Fehlerbehebung, Technologie, Raspberry Pi, node.js, npm

Warum kommt da dieser Fehler?

Hi, ich habe bereits eine Frage zu dem Thema gestellt, und möchte bei dieser hier nur mehr ins Detail gehen. Ich bin gerade dabei ein Discord Login auf einer Seite zu implementieren. Dabei kommt aber die ganze Zeit ein Fehler und ich weiß nicht, wie ich diesen beheben kann... Die Konsole sagt, dass dieser Fehler in Zeile 49 ist, und in dieser Zeile befindet sich folgendes:

fetch('https://discord.com/api/oauth2/token', {
        method: "POST", body: data_1
    })
        .then(response => response.json())
        .then(data => { // Make a request to the Discord API with the form data, convert the response to JSON, then take it and run the following code.
            axios.get("https://discord.com/api/users/@me", make_config(data.access_token)).then(response => { // Make a request yet again to the Discord API with the token from previously.
                res.status(200).send(response.data.username); // Send the username with a status code 200.
            }).catch(err => { // Handle any errors in the request (such as 401 errors).
                console.log(err); // Log the error in the console
                res.sendStatus(500); // Send a 500 error.
            });
        });

Fehleranzeige in der Konsole:

TypeError: fetch is not a function
    at C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\oauth.js:49:5
    at Layer.handle [as handle_request] (C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\express\lib\router\layer.js:95:5)
    at C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\express\lib\router\index.js:281:22
    at Function.process_params (C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\express\lib\router\index.js:275:10)
    at C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\body-parser\lib\read.js:130:5
    at invokeCallback (C:\Users\Dominik\Documents\Development\Websites\Norvex\ucp.norvex.eu\node_modules\raw-body\index.js:224:16)

Wie man aus dem Fehler erkennen kann, bemengelt die Konsole, dass "fetch" keine Funktion ist. Ich habe aber den Syntax von fetch gegoogelt und es nochmal überprüft aber keinen Fehler gefunden. Vielleicht sieht einer von euch einen Fehler im Code.

Ganzer Code:

https://jsfiddle.net/Atrapfare/zLedj3pf/

Danke für jede Antwort!

HTML, Webseite, JavaScript, node.js, Discord, npm

Meistgelesene Beiträge zum Thema Npm