Stavo aggiornando Node.js node
attraverso Homebrew's brew upgrade
, e non si collegava correttamente.
$ brew update
################################################################## 100.0%
(snip-snip formulae were updated)
$ brew upgrade
(snip-snip other upgrades)
==> Upgrading node
==> Downloading http://nodejs.org/dist/v0.8.11/node-v0.8.11.tar.gz==> ./configure --prefix=/usr/local/Cellar/node/0.8.11
==> make install
==> Caveats
Homebrew installed npm.
We recommend prepending the following path to your PATH environment
variable to have npm-installed binaries picked up:
/usr/local/share/npm/bin
Warning: Could not link node. Unlinking...
Error: Thebrew link
step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using 'brew link node'
==> Summary
/usr/local/Cellar/node/0.8.11: 856 files, 13M, built in 108 seconds
(snip-snip other upgrades)
Ho seguito i passaggi consigliati per forzare il collegamento.
$ brew link node
Linking /usr/local/Cellar/node/0... Warning: Could not link node. Unlinking...Error: Could not symlink file: /usr/local/Cellar/node/0.8.11/lib/node_modules/npm/scripts/relocate.sh
Target /usr/local/lib/node_modules/npm/scripts/relocate.sh already exists. You may need to delete it.
To force the link and delete this file, do:
brew link -f formula_nameTo list all files that would be deleted:
brew link -n formula_name
$ brew link -f node
Linking /usr/local/Cellar/node/0.8.11... 756 symlinks created
Ero sbalordito dal numero di collegamenti simbolici, quindi per curiosità ho provato a collegarlo di nuovo.
$ brew unlink node
Unlinking /usr/local/Cellar/node/0.8.11... 755 links removed
$ brew link node
Linking /usr/local/Cellar/node/0.8.11... 352 symlinks created
$ brew link node
Warning: Already linked: /usr/local/Cellar/node/0.8.11
$ which node
/usr/local/bin/node
$ brew unlink node
Unlinking /usr/local/Cellar/node/0.8.11... 351 links removed
$ brew link node
Linking /usr/local/Cellar/node/0.8.11... 304 symlinks created
$ brew unlink node
Unlinking /usr/local/Cellar/node/0.8.11... 303 links removed
$ brew link node
Linking /usr/local/Cellar/node/0.8.11... 304 symlinks created
$ brew unlink node
Unlinking /usr/local/Cellar/node/0.8.11... 303 links removed
Il processo si stabilizza a 304/303.
- Perché tanti symlink?
- Perché il numero di collegamento / scollegamento cambia da 756 a 303?
Modifica: ha eseguito la stessa procedura di aggiornamento / upgrade / collegamento / scollegamento sul computer di un collega: in questo caso i collegamenti simbolici sono passati da 775 a 318 a 226, dove si è stabilizzato. Qualcun altro ha numeri simili? Dipendono da altre ricette di brew installate, o forse da moduli di npm?