leancloud / avoscloud-code-command Goto Github PK
View Code? Open in Web Editor NEW此版本命令行工具已经废弃,以后不再维护。我们推出了基于 Go 的新版本的命令行工具
Home Page: https://leancloud.cn/docs/leanengine_cli.html
此版本命令行工具已经废弃,以后不再维护。我们推出了基于 Go 的新版本的命令行工具
Home Page: https://leancloud.cn/docs/leanengine_cli.html
类似那个clientTokenParser。
When I tried run command "avoscloud deploy", it always failed with the message: Upload cloud code files failed with '"Unauthorized."'.
What should I do?
抛出错误的地方是在avoscloud-code\bin\avoscloud文件的第61行:"Could not find user home directory";
是只考虑了Linux的情况么?
没有校验 Master Key,输入错了,后续部署会失败,很难发现原因。
某用户:
系统是win2008 64位 node.js 跟 npm 都安装好了
avoscloud-code 也能正确显示出 -h
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,跟这个有关系吗?
http://localhost:3000/avos 传入 json 数据会丢失类型,全部转成字符串了,参考
http://ticket.avosapps.com/tickets/54edb51ce4b00e64149d0092/threads
部署的时候偶尔会出现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."}'
现在代码是在 avoscloud 里面 fork 进程之后再运行的,debug 工具都无法观测到子进程的断点信息。
增加下列命令:
app list
查看所有应用app
显示当前所处的应用checkout <app>
切换应用add <app>
添加一个应用rm <app>
移除一个应用-a
选项来指定运行的应用。想在本地调试 云主机 工程,根据 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 (可从开发者平台的应用设置里找到):
Development version : '8f481a6193a0c8152a5e21baf9ab1827d08cdf18'
Development commit log : '1. change Key And Id.'
Production version : '8f481a6193a0c8152a5e21baf9ab1827d08cdf18'
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)
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
T-T 浏览器都用不了,只能靠服务器玩玩了,应该是个需求,求支持。
我用云代码命令行工具上传了云代码,现在本地没有代码了,想从leancloud服务端下载一份云代码,现在没法操作.
请打开:https://blog.leancloud.cn/591/
新建云代码项目
段落,里面说 假设您已经在我们的开发者平台创建了一个应用名为 test-app,您想为该应用创建云代码项目,您可以在项目存放的某个文件夹下面,直接运行下列命令:
既然一开始本地是没有项目代码的,何来 在项目存放的某个文件夹下面运行命令之说?通过浏览器打开 http://localhost:3000,可以看到 public 目录的 index.html 页面的内容
,我本地只能打开http://localhost:3000/avos页面,而 http://localhost:3000显示 Cannot GET /帮助用户发现一些常见的代码错误。
请问可以使用express 4.x吗?谢谢
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
执行一些网络和 api 调用检查,确认是否可以正常使用 leancloud
你好,我希望使用gulp来构建我的前端,本地是可以直接命令行输入gulp
就执行各种操作的。但是到了云端该怎么办呢???
我参考了一下javascript-sdk 里的说法,但是我只是希望能够简单地使用gulp,就一定要安装javascript-sdk么?还是有其他途径呢?
谢谢哦~~~~
从环境变量中获取到的 appKey 为 masterKey。
现在本地调试时,AV.Cloud.run 会调用到线上。
相关 ticket:https://ticket.avosapps.com/tickets/54ed736de4b077bf834a771a/threads
报错信息如下:
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
云代码升级到2.0 这里提及可以使用package.json 引入自己额外添加的第三方类库。
但是我不太明白这个后续要如何操作?
虽然 自己在本地npm install
之后运行avoscloud
能够顺利跑起来,但是部署到云环境里的话,是怎么办呢?云环境里会自动运行npm install
指令么?我测试下来好像没有这样,所以导致很多想引入的modules都是没有的,就报错了。
请教 是需要做什么能让云代码上也install 第三方库呢?谢谢了~
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)
有用户反馈在 io.js 下无法运行。
填写已经存在对象的 objectId
选择Class
_Followee
选择函数
_afterDelete
填写已经存在对象的 objectId
54b8d4dee4b0feaa44739205(这个是_Followee的objectId)
会输出 "Error : Not Found"
如何测试本地的class hook
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 了,但调试之类的没有任何问题。
在输入完应用类型后抛出异常,异常信息如下:
Error: Command failed: curl: (1) Protocol 'https not supported or disabled in libcurl
RT
@wanggc 希望能在命令行工具直接导出一些 api 报表的 csv 供用户使用。
使用这些功能的不是开发,可能是运营同学,所以执行该命令时时不会有一个「代码目录」的。
能否增加一个 avoscloud init 的参数,然后只填写 appId 和 masterKey 信息,然后当前目录就作为一个「工作目录」,可以执行一些命令,比如 CQL,或者导出数据什么的。
不过需要考虑一个问题:权限如何划分,因为统计数据的获取是需要 masterKey 的,但是有可能会出现防止运营人员 deploy 的动作。
我们是否做个使用「账号密码」方式初始化命令行呢?
命令行是否能作为一个功能更丰富的客户端呢?
有用户反馈 public 下的文件变动也会自动重启,这个没有必要。
错误信息:Upload cloud code files failed with '"{\"code\":1,\"error\":\"Forbidden to create by class permissions.\"}"'
应该时上传包后,向 _File 表添加记录时没有权限。是否使用 masterKey 来写 File 表的记录?
相关ticket:https://ticket.avosapps.com/tickets/553f54e5e4b05b80583c9240/threads
希望有命令合并掉deploy和publish
在本地调试的过程中:
在app.js中有var admin=require('cloud/admin.js');
改了admin的之后,admin的修改并未立即反应到app中的get请求中来。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.