无法在线安装插件,用git命令也失败


#1

安装插件atom-beautify,在线安装总失败,从社区帖子里找半天也没个有效解决方案。只能从网上找到git命令安装方法:
cd C:\Users\~\.atom\packages\ git clone https://github.com/Glavin001/atom-beautify cd atom-beautify apm install

命令行弹出如下错误代码:

Installing modules failed
npm WARN package.json Dependency ‘handlebars’ exists in both dependencies and devDependencies, using ‘handlebars@^4.0.2’ from dependencies
npm ERR! Windows_NT 6.2.9200
npm ERR! argv “C:\Users\wangy\AppData\Local\atom\app-1.7.2\resources\app\apm\bin\node.exe” “C:\Users\wangy\AppData\Local\atom\app-1.7.2\resources\app\apm\node_modules\npm\bin\npm-cli.js” “–globalconfig” “C:\Users\wangy\.atom\.apm\.apmrc” “–userconfig” “C:\Users\wangy\.atom\.apmrc” “install” “–target=0.36.8” “–arch=ia32”
npm ERR! node v0.10.40
npm ERR! npm v2.13.3

npm ERR! shasum check failed for C:\Users\wangy\AppData\Local\Temp\npm-3824-37d86055\registry.npmjs.org\prettydiff-\prettydiff-1.16.37.tgz
npm ERR! Expected: 459d20df58e150d361ed3121c1cc7f39eef3963a
npm ERR! Actual: d1ab7190d280892d2c6d062c766ef134610e2316
npm ERR! From: https://registry.npmjs.org/prettydiff/-/prettydiff-1.16.37.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues


本地插件安装失败
#2

在我这边最后一步不使用 apm install,改使用 npm install 能安装成功(没有使用 VPN 和 FQ 等措施)

mazhuang% cd ~/.atom/packages 
mazhuang% git clone git@github.com:Glavin001/atom-beautify.git
Cloning into 'atom-beautify'...
remote: Counting objects: 5674, done.
remote: Compressing objects: 100% (128/128), done.
remote: Total 5674 (delta 66), reused 0 (delta 0), pack-reused 5541
Receiving objects: 100% (5674/5674), 1.26 MiB | 5.00 KiB/s, done.
Resolving deltas: 100% (3523/3523), done.
Checking connectivity... done.
mazhuang% cd atom-beautify 
mazhuang% npm install
npm WARN deprecated lodash@1.2.1: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN prefer global marked@0.3.2 should be installed with -g
npm WARN prefer global jsonlint@1.6.2 should be installed with -g

> fsevents@1.0.11 install /Users/mazhuang/.atom/packages/atom-beautify/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/mazhuang/.atom/packages/atom-beautify/node_modules/fsevents/lib/binding/Release/node-v47-darwin-x64/fse.node" is installed via remote

> spawn-sync@1.0.15 postinstall /Users/mazhuang/.atom/packages/atom-beautify/node_modules/spawn-sync
> node postinstall


> atom-beautify@0.29.7 postinstall /Users/mazhuang/.atom/packages/atom-beautify
> node script/build-options.js

Beautifier options not found.
Building options for beautifiers
Done building options for beautifiers
Beautifier options successfully saved to /Users/mazhuang/.atom/packages/atom-beautify/src/options.json

> atom-beautify@0.29.7 prepublish /Users/mazhuang/.atom/packages/atom-beautify
> npm run docs


> atom-beautify@0.29.7 docs /Users/mazhuang/.atom/packages/atom-beautify
> coffee docs/

Generating options...
Loading options template...
Building documentation from template and options...
Writing documentation to file...
Done.


#3

我这边用npm install命令安装插件也有这句提示:
npm WARN package.json Dependency 'handlebars' exists in both dependencies and devDependencies, using 'handlebars@^4.0.2' from dependencies
后面的就看不懂了。。。


#4

@mzlogin 问一下你用的是CMD还是别的命令行环境?


#5

是 Mac 下的 zsh,在家木有用 Windows……


#6

错误是 npm ERR! shasum check failed for C:\Users\wangy\AppData\Local\Temp\npm-3824-37d86055\registry.npmjs.org\prettydiff-\prettydiff-1.16.37.tgz 校验和不符,应该是网络问题导致的下载中断。


#7

@mzlogin @jysperm 谢谢 ,搞定了。挺不好折腾的,不过也算是学了点儿知识。


#8

后来怎么弄好的?


#9

把从github clone的package文件夹都删了,把.apmcr文件里面设置的proxy都删了,然后重新clone,再用你说的npm install,就没事了。但是在线安装还是没办法,不是报错就是什么反应都没有。

成功安装了atom-beautify和atom-ctags

估计可能是我设置VPN有问题吧


#10

在线安装确实没什么好办法,我用公司的 VPN 平时一般稳定 FQ 的,在线安装插件成功率也不高。


#11

具体怎么做,可否告知下。我的.apmrc文件里面没有proxy。没有找到你说的.proxy文件。另外我执行npm-install时,提示我commit一个package.json文件。我commit后也没打的改变。话说你是在cmd执行npm install 的吧