Error Waktu Update NPM (Node Package Manager)


PERINGATAN!

Error ini terjadi kalo nginstall aplikasi nodejs nya via hombrew (MAC), kalo install dari hasil download di website nodejs, error ini gak akan terjadi.

Setelah liat di issues nya github npm dan hombrew :

https://github.com/npm/npm/issues/3794

https://github.com/Homebrew/homebrew/issues/22408

Sepertinya gak ada kejelasan gimana cara perbaikinya 😀

Errornya kurang lebih seperti ini :

➜ ~ npm -g update npm
npm http GET https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm/latest
npm http 304 https://registry.npmjs.org/npm/latest
npm http 304 https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm/1.3.4
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm/latest
npm http 304 https://registry.npmjs.org/npm/1.3.4
npm http 304 https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/1.3.25
npm http 304 https://registry.npmjs.org/npm/1.3.25
npm ERR! error rolling back Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
npm ERR! error rolling back at clobberFail (/usr/local/Cellar/node/0.10.25/lib/node_modules/npm/lib/utils/gently-rm.js:41:12)
npm ERR! error rolling back at next (/usr/local/Cellar/node/0.10.25/lib/node_modules/npm/lib/utils/gently-rm.js:27:14)
npm ERR! error rolling back at /usr/local/Cellar/node/0.10.25/lib/node_modules/npm/lib/utils/gently-rm.js:36:12
npm ERR! error rolling back at Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back npm@1.3.25 { [Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm] code: 'EEXIST', path: '/usr/local/bin/npm' }
npm ERR! Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
File exists: /usr/local/bin/npm
Move it away, and try again.
npm ERR! System Darwin 13.0.0
npm ERR! command "/usr/local/Cellar/node/0.10.25/bin/node" "/usr/local/bin/npm" "-g" "update" "npm"
npm ERR! cwd /Users/khannedy
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path /usr/local/bin/npm
npm ERR! code EEXIST
npm@1.3.4 /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/node_modules/npm
npm@1.3.4 /usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/npm
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/khannedy/npm-debug.log
npm ERR! not ok code 0

view raw
npm-update-error.log
hosted with ❤ by GitHub

Jika dapat masalah yang sama seperti saya, errornya intinya si npm gak bisa ngereplace symlink si npm nya sendiri, jadi cara agar bisa update symlink npm nya sendiri, kita paksa dia buat ngereplace, caranya gunakan perintah berikut ketika update nya

➜ ~ npm -gf update npm
npm WARN using –force I sure hope you know what you are doing.
npm http GET https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm/latest
npm http 304 https://registry.npmjs.org/npm/latest
npm http 304 https://registry.npmjs.org/npm/latest
npm http 304 https://registry.npmjs.org/npm/latest
npm http 304 https://registry.npmjs.org/npm/latest
npm http GET https://registry.npmjs.org/npm/1.3.4
npm http GET https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm/1.3.4
npm http GET https://registry.npmjs.org/npm/-/npm-1.3.4.tgz
npm http 304 https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-1.3.25.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.3.4.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.3.25.tgz
npm http GET https://registry.npmjs.org/npm/1.3.4
npm http GET https://registry.npmjs.org/npm/1.3.25
npm http 304 https://registry.npmjs.org/npm/1.3.4
npm http 304 https://registry.npmjs.org/npm/1.3.25
npm http GET https://registry.npmjs.org/npm/-/npm-1.3.4.tgz
npm http GET https://registry.npmjs.org/npm/-/npm-1.3.25.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.3.4.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.3.25.tgz
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@1.3.25 /usr/local/lib/node_modules/npm

view raw
npm-update.log
hosted with ❤ by GitHub

Sekarang npm selesai di update 🙂

2 pemikiran pada “Error Waktu Update NPM (Node Package Manager)

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s