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

有什么做宝宝辅食的网站吗seo排名工具给您好的建议

有什么做宝宝辅食的网站吗,seo排名工具给您好的建议,上海人才网官网移民,写作参考范文网站本文主要是小程序使用PB协议,以下时博主遇到的问题以及解决办法。 1、安装protobufjs npm install --save protobufjs 注意:我之前也使用过 npm install -g protobufjs去安装,但是出现以下的问题,关键是我使用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.yidumall.com/news/58720.html

相关文章:

  • 如何给网站添加icon百度搜索引擎优化的方法
  • 古镇企业网站建设宁波seo深度优化平台有哪些
  • wordpress 密码更改湖南网站优化
  • 厦门响应式网站制作百度首页关键词优化
  • 徐州网站建设案例百度竞价推广代理商
  • wordpress蘑菇街seo排名优化怎样
  • 中国移动网站上海网站seo快速排名
  • 信息平台网站的建设 文档2345网止导航
  • 没有网站可以做百度推广吗微信管理工具
  • 柳州网站建设网页设计与网站开发
  • 做外卖有哪些网站有哪些临沂今日头条新闻最新
  • 网站导航三角怎么做百度收录时间
  • 工商局网站清算组备案怎么做百度推广怎么收费标准
  • mysql做镜像网站哪个推广平台推广最靠谱
  • wordpress可以添加字段吗seo优化入门教程
  • 网页升级访问自动太原百度推广排名优化
  • 商城网站建设咨询seo是什么意思为什么要做seo
  • 装修设计图免费软件西安市seo排名按天优化
  • 做文员的网站知乎网络营销策划推广公司
  • 诚信档案建设网站首页seo经验
  • 远涛网站建设百度一下app下载安装
  • 兰州新增疫情最新消息seo基础知识包括什么
  • wordpress 无法编辑主题杭州seo搜索引擎优化公司
  • java网站开发经验网站构建的基本流程
  • 做设计英文网站现在最好的营销方式
  • 山西建站管理系统开发360免费建站官网
  • iis 新建网站没有文件夹权限seo入门基础教程
  • 3dweb做的网站磁力蜘蛛
  • 基于java的视频网站开发小程序开发公司排行榜
  • 动易政府网站模板河南自助建站seo公司