当前位置: 首页 > news >正文

苏州网站建设系统方案成都行业网站设计

苏州网站建设系统方案,成都行业网站设计,旅游电子商务网站建设论文,广告网站做动图怎么做本文主要是小程序使用PB协议#xff0c;以下时博主遇到的问题以及解决办法。 1、安装protobufjs npm install --save protobufjs 注意#xff1a;我之前也使用过 npm install -g protobufjs去安装#xff0c;但是出现以下的问题#xff0c;关键是我使用sudo 清除相关文件…本文主要是小程序使用PB协议以下时博主遇到的问题以及解决办法。 1、安装protobufjs npm install --save protobufjs 注意我之前也使用过 npm install -g protobufjs去安装但是出现以下的问题关键是我使用sudo 清除相关文件之后还是有问题心累啊 npm ERR! code EACCES npm ERR! syscall mkdir npm ERR! path /usr/local/lib/node_modules/protobufjs npm ERR! errno -13 npm ERR! Error: EACCES: permission denied, mkdir /usr/local/lib/node_modules/protobufjs npm ERR! [Error: EACCES: permission denied, mkdir /usr/local/lib/node_modules/protobufjs] { npm ERR! errno: -13, npm ERR! code: EACCES, npm ERR! syscall: mkdir, npm ERR! path: /usr/local/lib/node_modules/protobufjs npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. 遇到以上的报错信息运行强制清楚 sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share} 之后再安装即可 2、查看是否安装成功 npm list protobufjs 运行命令之后查看protobufjs版本号出现版本信息即为安装成功 3、运行pbjs protobufjs安装成功之后运行pbjs结果出现command not found: pbjs然后大家可以试一下 npx pbjs 然后会出现哇哦我总遇看到了胜利的希望感恩啊 Translates between file formats and generates static code.-t, --target Specifies the target format. Also accepts a path to require a custom target.json JSON representationjson-module JSON representation as a moduleproto2 Protocol Buffers, Version 2proto3 Protocol Buffers, Version 3static Static code without reflection (non-functional on its own)static-module Static code without reflection as a module-p, --path Adds a directory to the include path.-o, --out Saves to a file instead of writing to stdout.--sparse Exports only those types referenced from a main file (experimental).Module targets only:-w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.default Default wrapper supporting both CommonJS and AMDcommonjs CommonJS wrapperamd AMD wrapperes6 ES6 wrapper (implies --es6)closure A closure adding to protobuf.roots where protobuf is a global--dependency Specifies which version of protobuf to require. Accepts any valid module id-r, --root Specifies an alternative protobuf.roots name.-l, --lint Linter configuration. Defaults to protobuf.js-compatible rules:eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars--es6 Enables ES6 syntax (const/let instead of var)Proto sources only:--keep-case Keeps field casing instead of converting to camel case.Static targets only:--no-create Does not generate create functions used for reflection compatibility.--no-encode Does not generate encode functions.--no-decode Does not generate decode functions.--no-verify Does not generate verify functions.--no-convert Does not generate convert functions like from/toObject--no-delimited Does not generate delimited encode/decode functions.--no-beautify Does not beautify generated code.--no-comments Does not output any JSDoc comments.--force-long Enfores the use of Long for s-/u-/int64 and s-/fixed64 fields.--force-number Enfores the use of number for s-/u-/int64 and s-/fixed64 fields.--force-message Enfores the use of message instances instead of plain objects.usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] - 4、使用pbjs 转换一下.proto文件 最后一步来啦这里需要注意一下如果你的.proto没有放到根目录的时候需要找到相对应的文件夹在运行如果.proto在根目录直接运行即可 npx pbjs -t json awesome.proto awesome.json // awesome.protosyntax proto3;message AwesomeMessage {string awesome_field 1; // becomes awesomeField} 然后你就会发现得到一个awesome.json文件 {nested: {AwesomeMessage: {fields: {awesomeField: {type: string,id: 1}}}}} 但此时的json文件我们不能直接使用不过我们可以将json对象取出放到小程序项目当中去比如在小程序项目中新建一个awesome.js内容为 module.exports {nested: {AwesomeMessage: {fields: {awesomeField: {type: string,id: 1}}}}}; 然后大功告成总于可以愉快的使用protobufjs 啦。最后如果.proto文件内容更新需要重复步骤四更新js文件哦
http://www.w-s-a.com/news/405034/

相关文章:

  • wordpress多说读者墙seo分析师招聘
  • 视频网站开发计划书wordpress文件详情
  • 重庆付费网站推广电商网站 开发周期
  • thinkcmf 做企业网站视频播放类网站建设费用
  • vps网站助手大学选修课网站建设
  • 南浦电商网站建设北京海淀社保网站
  • 传奇网站模板怎么做的吗大连警方最新通告
  • 成都私人做公司网站的北京网站建设需要多少钱
  • 魔客吧是什麼程序做的网站代理厦门网站设计公司
  • 90设计手机站东营网站推广
  • 哪家购物网站建设好专门做水生植物销售网站
  • php医院网站开发兼职app开发网上app开发
  • 接任务做兼职的的网站衡阳手机网站设计
  • 徐州经济开发区网站佛山百度关键词seo外包
  • 肃宁网站建设有限责任公司法人承担什么责任
  • 珠海斗门建设局网站如何免费做网站
  • 自助外贸网站建设可直接打开网站的网页
  • 江苏城嘉建设工程有限公司网站潍坊网站定制公司
  • 四川省住房和城乡建设厅新网站宜昌建设厅网站
  • 建设网站一般流程建设开发网站
  • 设计外贸英文网站国家企业信息信用公信系统
  • 主题资源网站创建时 如何突出设计的特点阿里云是做网站的吗
  • 乌市建设工程质量监督站网站外资公司注册
  • 档案馆网站机房建设做游戏网站打鱼
  • 网站建设平台 创新模式搭建好ftp服务器 如何通过网站访问
  • 苏州集团网站制作设计网页制作软件ai
  • 网站建设新手教程视频教程手帐风格wordpress主题
  • 做投标网站条件网站更改指定字段
  • mvc5 网站开发之美做印刷网站公司
  • 医疗网站建设精英微信网站用什么制作的