MAC 用nvm安裝node出錯解決方法

使用終端輸入

$ nvm install v6.9.5

 

Downloading and installing node v6.9.5...

sed: 1: "s#/usr/local/opt/nvm

Sa ...": unterminated substitute pattern

Local cache found: 

Computing checksum with shasum -a 256

Checksums do not match: '\96d80603fcd74ce2cc261d980d4f06b6ec10432b446ab13359c8ad7f631991e8' found, '96d80603fcd74ce2cc261d980d4f06b6ec10432b446ab13359c8ad7f631991e8' expected.

Checksum check failed!

Removing the broken local cache...

Downloading https://nodejs.org/dist/v6.9.5/node-v6.9.5-darwin-x64.tar.gz...

######################################################################## 100.0%

Computing checksum with shasum -a 256

Checksums do not match: '\96d80603fcd74ce2cc261d980d4f06b6ec10432b446ab13359c8ad7f631991e8' found, '96d80603fcd74ce2cc261d980d4f06b6ec10432b446ab13359c8ad7f631991e8' expected.

Binary download failed, trying source.

Detected that you have 4 CPU core(s)

Running with 3 threads to speed up the build

sed: 1: "s#/usr/local/opt/nvm

Sa ...": unterminated substitute pattern

Local cache found: 

Computing checksum with shasum -a 256

Checksums do not match: '\f7e9ab702c5d1f5a3521199c04cc670fda3cf4b0e48548b09ac7ac874ccb504a' found, 'f7e9ab702c5d1f5a3521199c04cc670fda3cf4b0e48548b09ac7ac874ccb504a' expected.

Checksum check failed!

Removing the broken local cache...

Downloading https://nodejs.org/dist/v6.9.5/node-v6.9.5.tar.gz...

######################################################################## 100.0%

Computing checksum with shasum -a 256

Checksums do not match: '\f7e9ab702c5d1f5a3521199c04cc670fda3cf4b0e48548b09ac7ac874ccb504a' found, 'f7e9ab702c5d1f5a3521199c04cc670fda3cf4b0e48548b09ac7ac874ccb504a' expected.

nvm: install v6.9.5 failed!

 

解法方法:

終端輸入以下指令便可

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
posted @ 2017-02-15 03:38  chankenneth  阅读(845)  评论(0)    收藏  举报