node-gyp Fehler dabei npm installieren
Ich mache npm install aus einem Projekt und ich bin immer dieser seltsame Fehler in der node-gyp.
> pty.js@0.2.3 install /home/charizard/Open/terminal-codelearn/node_modules/pty.js
> node-gyp rebuild
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/tinycolor
npm http GET https://registry.npmjs.org/options
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:65:16)
gyp ERR! stack at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:228:20)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:110:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:659:7)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:106:17)
gyp ERR! stack at maybeClose (child_process.js:773:16)
gyp ERR! stack at Socket.<anonymous> (child_process.js:986:11)
gyp ERR! stack at Socket.EventEmitter.emit (events.js:103:17)
gyp ERR! stack at Pipe.close (net.js:458:12)
gyp ERR! System Linux 3.5.0-37-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/charizard/Open/terminal-codelearn/node_modules/pty.js
gyp ERR! node -v v0.11.8-pre
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
Wenn ich npm-Liste, bekomme ich folgende Meldung.
npm ERR! missing: pty.js@>=0.2.2, required by terminal-codelearn@0.0.3
npm ERR! not ok code 0
Sorry, ich bin völlig neu auf nodejs.
Du musst angemeldet sein, um einen Kommentar abzugeben.
Den Grund dies geschieht, ist, dass
node-gyp
wertet die-pre
Teil[email protected]
als-1
. Die Installation erhält eine404
- und scheitert.Um dieses problem zu lösen, verwenden Sie eine stabile Version von Node.js. Andernfalls müssen Sie die Knoten Quelle herum, und verwenden Sie die
--nodedir
Flagge.Lesen Sie mehr über dieses Thema hier.
Ich dies Problem gelöst durch ein Upgrade meiner version der Knoten auf eine stabile version (z.B. kein "pre - version" - Ihre version 0.8.13-pre) mit den folgenden: