最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Mac中安装React Native期间升级node出错:Error node not installed

Mac crifan 4221浏览 0评论

折腾:

【记录】折腾React Native iOS 

期间,

在Mac中安装React Native的期间,去升级node,结果失败:

➜  pic brew upgrade node
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Error: node not installed

但是之前确定是已经安装了node的:

➜  pic node -v

v4.4.7

再次去重新尝试安装环境

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
➜  ~ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Homebrew
/usr/local/sbin
/usr/local/var
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Homebrew /usr/local/sbin /usr/local/var
Password:
Sorry, try again.
Password:
Sorry, try again.
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Homebrew /usr/local/sbin /usr/local/var
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown crifan /usr/local/Homebrew /usr/local/sbin /usr/local/var
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Homebrew /usr/local/sbin /usr/local/var
==> /usr/bin/sudo /bin/mkdir -p /Users/crifan/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/crifan/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown crifan /Users/crifan/Library/Caches/Homebrew
==> Downloading and installing Homebrew…
remote: Counting objects: 5046, done.
remote: Compressing objects: 100% (3170/3170), done.
remote: Total 5046 (delta 2785), reused 3308 (delta 1710), pack-reused 0
Receiving objects: 100% (5046/5046), 2.66 MiB | 508.00 KiB/s, done.
Resolving deltas: 100% (2785/2785), done.
From https://github.com/Homebrew/brew
* [new branch]      master     -> origin/master
* [new tag]         0.1        -> 0.1
* [new tag]         0.2        -> 0.2
* [new tag]         0.3        -> 0.3
* [new tag]         0.4        -> 0.4
* [new tag]         0.5        -> 0.5
* [new tag]         0.6        -> 0.6
* [new tag]         0.7        -> 0.7
* [new tag]         0.7.1      -> 0.7.1
* [new tag]         0.8        -> 0.8
* [new tag]         0.8.1      -> 0.8.1
* [new tag]         0.9        -> 0.9
* [new tag]         0.9.1      -> 0.9.1
* [new tag]         0.9.2      -> 0.9.2
* [new tag]         0.9.3      -> 0.9.3
* [new tag]         0.9.4      -> 0.9.4
* [new tag]         0.9.5      -> 0.9.5
* [new tag]         0.9.8      -> 0.9.8
* [new tag]         0.9.9      -> 0.9.9
* [new tag]         1.0.0      -> 1.0.0
* [new tag]         1.0.1      -> 1.0.1
* [new tag]         1.0.2      -> 1.0.2
* [new tag]         1.0.3      -> 1.0.3
* [new tag]         1.0.4      -> 1.0.4
* [new tag]         1.0.5      -> 1.0.5
* [new tag]         1.0.6      -> 1.0.6
* [new tag]         1.0.7      -> 1.0.7
* [new tag]         1.0.8      -> 1.0.8
* [new tag]         1.0.9      -> 1.0.9
* [new tag]         1.1.0      -> 1.1.0
* [new tag]         1.1.1      -> 1.1.1
* [new tag]         1.1.10     -> 1.1.10
* [new tag]         1.1.2      -> 1.1.2
* [new tag]         1.1.3      -> 1.1.3
* [new tag]         1.1.4      -> 1.1.4
* [new tag]         1.1.5      -> 1.1.5
* [new tag]         1.1.6      -> 1.1.6
* [new tag]         1.1.7      -> 1.1.7
* [new tag]         1.1.8      -> 1.1.8
* [new tag]         1.1.9      -> 1.1.9
HEAD is now at a74b7ad Merge pull request #2043 from reitermarkus/create-caskroom
==> Tapping homebrew/core
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…
remote: Counting objects: 4138, done.
remote: Compressing objects: 100% (4013/4013), done.
remote: Total 4138 (delta 30), reused 444 (delta 10), pack-reused 0
Receiving objects: 100% (4138/4138), 3.31 MiB | 472.00 KiB/s, done.
Resolving deltas: 100% (30/30), done.
Checking connectivity… done.
Tapped 4011 formulae (4,166 files, 10.4M)
==> Cleaning up /Library/Caches/Homebrew…
Removing: /Library/Caches/Homebrew/node–icu4c-56.1.tgz.incomplete… (5.4M)
Removing: /Library/Caches/Homebrew/node-6.1.0.tar.xz… (11.5M)
Removing: /Library/Caches/Homebrew/xz-5.2.2.tar.gz… (1.4M)
==> Migrating /Library/Caches/Homebrew to /Users/crifan/Library/Caches/Homebrew…
==> Deleting /Library/Caches/Homebrew…
Already up-to-date.
Error: Could not link:
/usr/local/etc/bash_completion.d/brew
Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/doc/homebrew
Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/zsh/site-functions/_brew
Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/man/man1/brew.1
Please delete these paths and run `brew update`.
==> Installation successful!
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
==> Next steps:
– Run `brew help` to get started
– Further documentation:
➜  ~ which brew
/usr/local/bin/brew
➜  ~ brew –help
Example usage:
  brew search [TEXT|/REGEX/]
  brew (info|home|options) [FORMULA…]
  brew install FORMULA…
  brew update
  brew upgrade [FORMULA…]
  brew uninstall FORMULA…
  brew list [FORMULA…]
Troubleshooting:
  brew config
  brew doctor
  brew install -vd FORMULA
Developers:
  brew create [URL [–no-fetch]]
  brew edit [FORMULA…]
Further help:
  man brew
  brew help [COMMAND]
  brew home
➜  ~ brew –version
Homebrew 1.1.10
Homebrew/homebrew-core (git revision 2f39; last commit 2017-02-17)

继续去:

brew install node

结果一直显示更新,不动了

重新去:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

 

后来,终于可以了:

➜  ~ brew install node
==> Downloading https://homebrew.bintray.com/bottles/node-7.7.1.sierra.bottle.tar.gz
##########################################################                81.0%

但是好像是需要删掉重写安装?

➜  ~ brew install node
==> Downloading https://homebrew.bintray.com/bottles/node-7.7.1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring node-7.7.1.sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm ‘/usr/local/bin/node’
To force the link and overwrite all conflicting files:
  brew link –overwrite node
To list all files that would be deleted:
  brew link –overwrite –dry-run node
Possible conflicting files are:
/usr/local/bin/node
/usr/local/include/node/android-ifaddrs.h
/usr/local/include/node/ares.h
/usr/local/include/node/ares_version.h
/usr/local/include/node/common.gypi
/usr/local/include/node/config.gypi
/usr/local/include/node/libplatform/libplatform.h
/usr/local/include/node/nameser.h
/usr/local/include/node/node.h
/usr/local/include/node/node_buffer.h
/usr/local/include/node/node_object_wrap.h
/usr/local/include/node/node_version.h
/usr/local/include/node/openssl/aes.h
/usr/local/include/node/openssl/archs/BSD-x86/opensslconf.h
/usr/local/include/node/openssl/archs/BSD-x86_64/opensslconf.h
/usr/local/include/node/openssl/archs/VC-WIN32/opensslconf.h
/usr/local/include/node/openssl/archs/VC-WIN64A/opensslconf.h
/usr/local/include/node/openssl/archs/aix-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/aix64-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/darwin-i386-cc/opensslconf.h
/usr/local/include/node/openssl/archs/darwin64-x86_64-cc/opensslconf.h
/usr/local/include/node/openssl/archs/linux-aarch64/opensslconf.h
/usr/local/include/node/openssl/archs/linux-armv4/opensslconf.h
/usr/local/include/node/openssl/archs/linux-elf/opensslconf.h
/usr/local/include/node/openssl/archs/linux-ppc/opensslconf.h
/usr/local/include/node/openssl/archs/linux-ppc64/opensslconf.h
/usr/local/include/node/openssl/archs/linux-x32/opensslconf.h
/usr/local/include/node/openssl/archs/linux-x86_64/opensslconf.h
/usr/local/include/node/openssl/archs/solaris-x86-gcc/opensslconf.h
/usr/local/include/node/openssl/archs/solaris64-x86_64-gcc/opensslconf.h
/usr/local/include/node/openssl/asn1.h
/usr/local/include/node/openssl/asn1_mac.h
/usr/local/include/node/openssl/asn1t.h
/usr/local/include/node/openssl/bio.h
/usr/local/include/node/openssl/blowfish.h
/usr/local/include/node/openssl/bn.h
/usr/local/include/node/openssl/buffer.h
/usr/local/include/node/openssl/camellia.h
/usr/local/include/node/openssl/cast.h
/usr/local/include/node/openssl/cmac.h
/usr/local/include/node/openssl/cms.h
/usr/local/include/node/openssl/comp.h
/usr/local/include/node/openssl/conf.h
/usr/local/include/node/openssl/conf_api.h
/usr/local/include/node/openssl/crypto.h
/usr/local/include/node/openssl/des.h
/usr/local/include/node/openssl/des_old.h
/usr/local/include/node/openssl/dh.h
/usr/local/include/node/openssl/dsa.h
/usr/local/include/node/openssl/dso.h
/usr/local/include/node/openssl/dtls1.h
/usr/local/include/node/openssl/e_os2.h
/usr/local/include/node/openssl/ebcdic.h
/usr/local/include/node/openssl/ec.h
/usr/local/include/node/openssl/ecdh.h
/usr/local/include/node/openssl/ecdsa.h
/usr/local/include/node/openssl/engine.h
/usr/local/include/node/openssl/err.h
/usr/local/include/node/openssl/evp.h
/usr/local/include/node/openssl/hmac.h
/usr/local/include/node/openssl/idea.h
/usr/local/include/node/openssl/krb5_asn.h
/usr/local/include/node/openssl/kssl.h
/usr/local/include/node/openssl/lhash.h
/usr/local/include/node/openssl/md4.h
/usr/local/include/node/openssl/md5.h
/usr/local/include/node/openssl/mdc2.h
/usr/local/include/node/openssl/modes.h
/usr/local/include/node/openssl/obj_mac.h
/usr/local/include/node/openssl/objects.h
/usr/local/include/node/openssl/ocsp.h
/usr/local/include/node/openssl/opensslconf.h
/usr/local/include/node/openssl/opensslv.h
/usr/local/include/node/openssl/ossl_typ.h
/usr/local/include/node/openssl/pem.h
/usr/local/include/node/openssl/pem2.h
/usr/local/include/node/openssl/pkcs12.h
/usr/local/include/node/openssl/pkcs7.h
/usr/local/include/node/openssl/pqueue.h
/usr/local/include/node/openssl/rand.h
/usr/local/include/node/openssl/rc2.h
/usr/local/include/node/openssl/rc4.h
/usr/local/include/node/openssl/ripemd.h
/usr/local/include/node/openssl/rsa.h
/usr/local/include/node/openssl/safestack.h
/usr/local/include/node/openssl/seed.h
/usr/local/include/node/openssl/sha.h
/usr/local/include/node/openssl/srp.h
/usr/local/include/node/openssl/srtp.h
/usr/local/include/node/openssl/ssl.h
/usr/local/include/node/openssl/ssl2.h
/usr/local/include/node/openssl/ssl23.h
/usr/local/include/node/openssl/ssl3.h
/usr/local/include/node/openssl/stack.h
/usr/local/include/node/openssl/symhacks.h
/usr/local/include/node/openssl/tls1.h
/usr/local/include/node/openssl/ts.h
/usr/local/include/node/openssl/txt_db.h
/usr/local/include/node/openssl/ui.h
/usr/local/include/node/openssl/ui_compat.h
/usr/local/include/node/openssl/whrlpool.h
/usr/local/include/node/openssl/x509.h
/usr/local/include/node/openssl/x509_vfy.h
/usr/local/include/node/openssl/x509v3.h
/usr/local/include/node/stdint-msvc2008.h
/usr/local/include/node/tree.h
/usr/local/include/node/uv-aix.h
/usr/local/include/node/uv-bsd.h
/usr/local/include/node/uv-darwin.h
/usr/local/include/node/uv-errno.h
/usr/local/include/node/uv-linux.h
/usr/local/include/node/uv-sunos.h
/usr/local/include/node/uv-threadpool.h
/usr/local/include/node/uv-unix.h
/usr/local/include/node/uv-version.h
/usr/local/include/node/uv-win.h
/usr/local/include/node/uv.h
/usr/local/include/node/v8-debug.h
/usr/local/include/node/v8-platform.h
/usr/local/include/node/v8-profiler.h
/usr/local/include/node/v8-testing.h
/usr/local/include/node/v8-util.h
/usr/local/include/node/v8-version.h
/usr/local/include/node/v8.h
/usr/local/include/node/v8config.h
/usr/local/include/node/zconf.h
/usr/local/include/node/zlib.h
/usr/local/share/doc/node/gdbinit
/usr/local/share/man/man1/node.1
/usr/local/share/systemtap/tapset/node.stp
/usr/local/lib/dtrace/node.d
==> Using the sandbox
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/7.7.1: 3,148 files, 40.2M

不过已经有了node,即算了:

➜  ~ node –version
v4.4.7

就这么用吧。

【总结】

好像就是:

之前已经安装了node,但是再去升级node却失败。

总之好像是:

重新安装了

brew install node

就可以了?

转载请注明:在路上 » 【已解决】Mac中安装React Native期间升级node出错:Error node not installed

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.218 seconds, using 22.16MB memory