npm Update ist defekt, wie kann ich das beheben?

1158
Daniel

Ich entschied, dass es Zeit war, meine nodeund meine npmVersionen zu aktualisieren . Ich hatte diese Versionen:

$ node -v v6.9.4  $ npm -v 5.5.1 

Ich lief ein, brew upgrade nodeweil ich natürlich auf einem Mac bin.

Ich habe die folgenden Fehler und Vorschläge zur Behebung erhalten:

==> Pouring node-9.3.0_1.sierra.bottle.tar.gz Warning: The post-install step did not complete successfully You can try again using `brew postinstall node` ==> Caveats Bash completion has been installed to: /usr/local/etc/bash_completion.d ==> Summary /usr/local/Cellar/node/9.3.0_1: 5,125 files, 49.6MB danales-MacBook-Pro:Projects danale$ node -v v6.9.4 danales-MacBook-Pro:Projects danale$ npm -v module.js:471 throw err; ^  Error: Cannot find module '../lib/utils/unsupported.js' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21 at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) 

Beim Versuch habe brew postinstall nodeich folgende Fehlermeldung erhalten:

$ brew postinstall node ==> Postinstalling node Error: Permission denied @ rb_sysopen - /usr/local/lib/node_modules/npm/BROKEN.org 

Es scheint ein Erlaubnisfehler zu sein, aber ich weiß nicht, wie ich diesen Fehler beheben kann.

0

1 Antwort auf die Frage

0
Daniel

Nach langem Ausprobieren habe ich die nodevia komplett entfernt brew uninstall --force nodeund bin dann rausgerannt brew install node.

Danach bin ich gerannt curl -L https://www.npmjs.org/install.sh | sh

Überprüfte beide installierten Versionen:

$ npm -v 5.6.0  $ node -v v9.3.0