1. 使用brew install node 命令安装node 时遇到的问题:
MacBook-Pro:~ zh$ brew install node
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz
Already downloaded: /Users/zh/Library/Caches/Homebrew/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz
Error: Checksum mismatch.
Expected: f1db8863543d256e6a8e704bf618025030b3d22a7a6b19749d19f599b5554212
Actual: d3843f61522afd7a5340aa055847e549ab5f3b0a8ffafab46b556d427b903131
Archive: /Users/zh/Library/Caches/Homebrew/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to upgrade vendor Ruby.
解决方法:
删除: /Users/zh/Library/Caches/Homebrew/portable-ruby-2.3.3_2.leopard_64.bottle.tar.gz 文件 后重新 运行 brew install node 命令
2. 安装vue 时报错 无pacakge.json 文件
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #85c80b; background-color: #000000 }
span.s1 { }
span.s2 { color: #bfbfbf }
span.s3 { color: #000000; background-color: #999900 }
span.s4 { color: #d53bd3 }
span.s5 { color: #0220b3 }
zhaichuangdeMacBook-Pro:~ zhaichuang$ sudo npm install vue
Password:
npm WARN saveError ENOENT: no such file or directory, open ‘/Users/zhaichuang/package.json‘
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open ‘/Users/zhaichuang/package.json‘
npm WARN zhaichuang No description
npm WARN zhaichuang No repository field.
npm WARN zhaichuang No README data
npm WARN zhaichuang No license field.
解决方法:
删除 ~(当前目录)下的 package-lock.json 文件 ,运行命令:sudo npm install vue -g
3. 安装vue-cli 时 遇到 npm ERR! Unexpected end of JSON input while parsing near ‘...prebuilt":"^2.1.4","p‘
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #85c80b; background-color: #000000 }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #85c80b; background-color: #000000; min-height: 19.0px }
span.s1 { }
span.s2 { color: #bfbfbf }
span.s3 { color: #000000; background-color: #999900 }
span.s4 { color: #d53bd3 }
span.s5 { color: #991200 }
zhaichuangdeMacBook-Pro:~ zhaichuang$ sudo npm install vue-cli -g
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! Unexpected end of JSON input while parsing near ‘...prebuilt":"^2.1.4","p‘
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zhaichuang/.npm/_logs/2018-06-01T14_24_54_473Z-debug.log
解决方法: 使用命令 npm cache clean --force 清除缓存 然后再运行命令:sudo npm i --global vue-cli 安装成功
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #85c80b; background-color: #000000 }
span.s1 { }
span.s2 { text-decoration: underline; color: #c33720 }
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #85c80b; background-color: #000000 }
span.s1 { }
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #85c80b; background-color: #000000 }
span.s1 { }
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #85c80b; background-color: #000000 }
span.s1 { }
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Monaco; color: #85c80b; background-color: #000000 }
span.s1 { }
原文地址:https://www.cnblogs.com/mybefly/p/9123963.html