GithubHelp home page GithubHelp logo

leancloud / avoscloud-code-command Goto Github PK

View Code? Open in Web Editor NEW
66.0 66.0 18.0 3.69 MB

此版本命令行工具已经废弃,以后不再维护。我们推出了基于 Go 的新版本的命令行工具

Home Page: https://leancloud.cn/docs/leanengine_cli.html

HTML 8.56% JavaScript 89.10% Shell 2.22% PHP 0.12%

avoscloud-code-command's People

Contributors

aisk avatar gongt avatar gzzhanghao avatar jysperm avatar killme2008 avatar leeyeh avatar sdjcw avatar sparanoid avatar wangxiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avoscloud-code-command's Issues

windows下不能找到用户路径

抛出错误的地方是在avoscloud-code\bin\avoscloud文件的第61行:"Could not find user home directory";
是只考虑了Linux的情况么?

提供windows支持

某用户:
系统是win2008 64位 node.js 跟 npm 都安装好了
avoscloud-code 也能正确显示出 -h

使用upload命令出现 Could not find user home directory 错误

使用 new 命令出现

Error: Command failed:
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify faile
d
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

安装到最后出现错误

npm ERR! Error: shasum check failed for /Users/Steven/tmp/npm-1400-yGJEVj1R/1398086726763-0.2757351635955274/tmp.tgz
npm ERR! Expected: b9abf8caf0bd9773cb3dea29344119872582446d
npm ERR! Actual:   8007803cef1443b8386969863e2d5dd1f4acdb2a
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR!     at ReadStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR!     at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:910:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "git+https://github.com/avos/CloudCodeMockSDK"
npm ERR! cwd /Users/Steven
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5

而且还一直卡在这里,请问是什么原因造成的?

我自己安装了 JDK 7.0,跟这个有关系吗?

部署云代码时偶尔会401 Unauthorized

部署的时候偶尔会出现error 401 Unauthorized,重试几遍就会成功。其中一次的log如下

MacBook:xxx_CloudCode fengxiaoping$ avoscloud deploy
[INFO]: Cloud Code Project Home Directory: /xxx/xxx_CloudCode/
[INFO]: Current App: origin 5uzb76lzdkmrgbll3ib3gizg1o88lyw3jhsqvbc8e7iqnilx
Compress cloud code files...
Wrote compressed file /var/folders/ft/jfytvs8d0yn1lfhsw9n4448w0000gn/T/1417684988110.tar.gz ...
Begin to upload cloud code files...
Upload cloud code files successfully. Begin to deploy...
Sorry, try to deploy cloud code failed with '{"code":401,"error":"Unauthorized."}'

增加 debug 支持

现在代码是在 avoscloud 里面 fork 进程之后再运行的,debug 工具都无法观测到子进程的断点信息。

一个项目可以部署到多个应用

增加下列命令:

  • app list 查看所有应用
  • app 显示当前所处的应用
  • checkout <app> 切换应用
  • add <app> 添加一个应用
  • rm <app> 移除一个应用
  • 其他命令添加 -a 选项来指定运行的应用。

使用 AVOScloud new 等方法都是好好的,但是 无法使用 avoscloud 开启本地部署

想在本地调试 云主机 工程,根据 Guide 一步步走下去,创建工程, 但是执行avoscloud 本地启动这步出错了。无法执行。。

D:\gitosc\gitCloud\cloudcode-test>avoscloud status
[INFO]: Cloud Code Project Home Directory: D:\gitosc\gitCloud\cloudcode-test
[INFO]: Current App: origin wjm04batbnzn0rigyo6zzwcz5rzntlyvgv3l6y7bsy2bncy9
请输入应用的 Master Key (可从开发者平台的应用设置里找到):

Cloud code status is:

Development version : '8f481a6193a0c8152a5e21baf9ab1827d08cdf18'
Development commit log : '1. change Key And Id.'
Production version : '8f481a6193a0c8152a5e21baf9ab1827d08cdf18'

Production commit log : '1. change Key And Id.'

D:\gitosc\gitCloud\cloudcode-test>avoscloud
提示:您可以敲入 rs 命令并回车来重启本进程
module.js:338
throw err;
^
Error: Cannot find module 'D:\gitosc\gitCloud\cloudcode-test"C:\Program'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

无法部署本地代码到开发环境

上传工程是正常的,在部署代码时抛出异常,异常代码如下:

undefined:2
<!doctype html>
^
SyntaxError: Unexpected token <
at Object.parse (native)
at Object.util.requestCloud.error (c:\Users\jyun\AppData\Roaming\npm\node_mo
dules\avoscloud-code\bin\avoscloud:198:79)
at c:\Users\jyun\AppData\Roaming\npm\node_modules\avoscloud-code\node_module
s\avoscloud-sdk\lib\av.js:3743:21
at wrappedRejectedCallback (c:\Users\jyun\AppData\Roaming\npm\node_modules\a
voscloud-code\node_modules\avoscloud-sdk\lib\av.js:3674:21)
at c:\Users\jyun\AppData\Roaming\npm\node_modules\avoscloud-code\node_module
s\avoscloud-sdk\lib\av.js:3627:9
at Array.forEach (native)
at Object..each..forEach [as _arrayEach](c:UsersjyunAppDataRoamingnp
mnode_modulesavoscloud-codenode_modulesavoscloud-sdklibav.js:95:11)
at _.extend.reject (c:\Users\jyun\AppData\Roaming\npm\node_modules\avoscloud
-code\node_modules\avoscloud-sdk\lib\av.js:3626:10)
at xhr.onreadystatechange (c:\Users\jyun\AppData\Roaming\npm\node_modules\av
oscloud-code\lib\util.js:64:13)
at dispatchEvent (c:\Users\jyun\AppData\Roaming\npm\node_modules\avoscloud-c
ode\node_modules\avoscloud-sdk\node_modules\xmlhttprequest\lib\XMLHttpRequest.js
:570:25)

不支持zsh Bash Completion

OS X 10.10.3
在.zshrc 添加source后报错:

Last login: Wed Apr  8 13:20:09 on ttys001
/Users/wuhaolin/.avoscloud_completion.sh:67: command not found: complete

求支持 ES6 的方案

T-T 浏览器都用不了,只能靠服务器玩玩了,应该是个需求,求支持。

云代码命令行工具文档的文字描述不准确

请打开:https://blog.leancloud.cn/591/

  1. 注意到 新建云代码项目 段落,里面说 假设您已经在我们的开发者平台创建了一个应用名为 test-app,您想为该应用创建云代码项目,您可以在项目存放的某个文件夹下面,直接运行下列命令: 既然一开始本地是没有项目代码的,何来 在项目存放的某个文件夹下面运行命令之说?
    改成
    mkdir test-app;
    cd test-app;
    是否比较妥当呢?
  2. 注意到通过浏览器打开 http://localhost:3000,可以看到 public 目录的 index.html 页面的内容,我本地只能打开http://localhost:3000/avos页面,而 http://localhost:3000显示 Cannot GET /

Win7 32位 在项目根目录运行avoscloud报错

nodejs版本为v0.10.35

module.js:340
    throw err;
          ^
Error: Cannot find module 'D:\My Documents\GitHub\afan\"D:\Program'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3

增加 ping 命令

执行一些网络和 api 调用检查,确认是否可以正常使用 leancloud

Cannot find module 'bytes'?

报错信息如下:

module.js:338
    throw err;
          ^
Error: Cannot find module 'bytes'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (/usr/local/lib/node_modules/avoscloud-code/lib/cloud_code.js:365:21)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/benji/Documents/vagrant/workspace/akapollo/node_modules/express/node_modules/connect/lib/utils.js:393:22)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (/usr/local/lib/node_modules/avoscloud-code/lib/cloud_code.js:365:21)

Node.js Version: 0.12.0

添加package.json之后会报错找不到对应的modules

云代码升级到2.0 这里提及可以使用package.json 引入自己额外添加的第三方类库。

我想引入某个第三方库

但是我不太明白这个后续要如何操作?
虽然 自己在本地npm install之后运行avoscloud能够顺利跑起来,但是部署到云环境里的话,是怎么办呢?云环境里会自动运行npm install指令么?我测试下来好像没有这样,所以导致很多想引入的modules都是没有的,就报错了。

请教 是需要做什么能让云代码上也install 第三方库呢?谢谢了~

升级0.7.6后,报 Error: Cannot find module 'boom' 错误

module.js:338
    throw err;
    ^
Error: Cannot find module 'boom'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (/usr/local/lib/node_modules/avoscloud-code/lib/cloud_code.js:366:21)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/plusman/Desktop/Open/hyxNodeServer/node_modules/request/node_modules/hawk/lib/index.js:3:33)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (/usr/local/lib/node_modules/avoscloud-code/lib/cloud_code.js:366:21)

本地测试avos的Class Hook

填写已经存在对象的 objectId
选择Class
_Followee
选择函数
_afterDelete
填写已经存在对象的 objectId
54b8d4dee4b0feaa44739205(这个是_Followee的objectId)

会输出 "Error : Not Found"

如何测试本地的class hook

关于child_process.spawn和windows

readme里多了一行。。。windows用户要把node装在C盘。。。

据说在windows上运行一个外部程序(node.exe也是一个外部程序。。),应该用

C:\Windows\system32\cmd.exe /C xxx.exe arg1 arg2
而 C:\Windows\system32\cmd.exe 这个路径保存在 process.env.comspec 里
于是
child_process.spawn(process.env.comspec, ['/C','node',......]);

原因是node在windows上在PATH里搜索外部程序会出一些问题,所以应该使用绝对路径,但绝对路径不容易得到。
而cmd.exe启动外部程序的时候,在PATH里搜索的过程是没有问题的,同时它的位置肯定不会变,所以通过启动一个cmd.exe,再让它找到并启动需要的程序就能保证在所有电脑上都不会出问题。

不知道是不是这个原因导致的。。

(PS。。我就是把node装在 D:\nodejs\node.exe 了,但调试之类的没有任何问题。

能否增加非项目部署相关的功能,比如说将 api 报表导出 csv

@wanggc 希望能在命令行工具直接导出一些 api 报表的 csv 供用户使用。
使用这些功能的不是开发,可能是运营同学,所以执行该命令时时不会有一个「代码目录」的。

能否增加一个 avoscloud init 的参数,然后只填写 appId 和 masterKey 信息,然后当前目录就作为一个「工作目录」,可以执行一些命令,比如 CQL,或者导出数据什么的。

不过需要考虑一个问题:权限如何划分,因为统计数据的获取是需要 masterKey 的,但是有可能会出现防止运营人员 deploy 的动作。

我们是否做个使用「账号密码」方式初始化命令行呢?
命令行是否能作为一个功能更丰富的客户端呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.