@arcblock/abtnode-docs
Version:
ABT Node Documentation, a help documentation for quickly get started with ABT Node.
1 lines • 14.1 kB
JSON
{"componentChunkName":"component---node-modules-arcblock-gatsby-theme-docs-src-templates-documentation-js","path":"/zh/developer/config-dev-env","result":{"data":{"file":{"changeTime":"5 minutes ago","childMarkdownRemark":{"frontmatter":{"author":"polunzh","category":"","date":null,"description":"配置开发环境","draft":null,"keywords":"abtnode, development","language":"zh","layout":"documentation","path":"/zh/developer/config-dev-env","tags":["abtnode","development"],"title":"配置开发环境"},"htmlAst":{"type":"root","children":[{"type":"element","tagName":"h2","properties":{"id":"install-nodejs","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#install-nodejs","ariaLabel":"install nodejs permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Install Node.js"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://nodejs.org/en/download/"},"children":[{"type":"text","value":"Node.js 官网"}]},{"type":"text","value":"介绍了多种安装 Node.js 的方法,不过我们这里推荐使用 "},{"type":"element","tagName":"a","properties":{"href":"https://github.com/nvm-sh/nvm"},"children":[{"type":"text","value":"nvm"}]},{"type":"text","value":" 安装 Node.js, 因为这样的话可以很方便的在不同的 Node.js 版本之间切换。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"install-nvm","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#install-nvm","ariaLabel":"install nvm permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Install nvm"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"nvm 的安装比较容易,直接执行一条 shell 脚本就可以了, nvm 当前最新版本是 v0.37.2:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"],"curl":"","-o-":"","<https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh>":"","|":"","bash":""},"children":[{"type":"text","value":"$ curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh> | bash\n# 或者使用 wget\n$ wget -qO- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh> | bash\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"当然,最稳妥的方式是复制官方最新的 shell 脚本: "},{"type":"element","tagName":"a","properties":{"href":"https://github.com/nvm-sh/nvm#install--update-script"},"children":[{"type":"text","value":"https://github.com/nvm-sh/nvm#install--update-script"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"安装 nvm 后, 需要重启终端,或者执行下面的脚本使 nvm 命令生效:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"],"NVM_DIR":"$HOME/.nvm"},"children":[{"type":"text","value":"export NVM_DIR=\"$HOME/.nvm\"\n[ -s \"$NVM_DIR/nvm.sh\" ] && \\\\. \"$NVM_DIR/nvm.sh\" # This loads nvm\n[ -s \"$NVM_DIR/bash_completion\" ] && \\\\. \"$NVM_DIR/bash_completion\" # This loads nvm bash_completion\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"安装-lts-版本-nodejs","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#%E5%AE%89%E8%A3%85-lts-%E7%89%88%E6%9C%AC-nodejs","ariaLabel":"安装 lts 版本 nodejs permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"安装 LTS 版本 Node.js"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"安装完成 nvm 后我们就可以安装 Node.js 了, 我们推荐安装最新的 LTS 版本:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"],"nvm":"","install":"","--lts":""},"children":[{"type":"text","value":"$ nvm install --lts\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"使用 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"node -v"}]},{"type":"text","value":" 命令查看已安装的 Node.js 版本。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"install-abt-node","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#install-abt-node","ariaLabel":"install abt node permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Install ABT Node"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"完成安装 Node.js 后就可以安装 ABT Node 了:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"],"npm":"","install":"","-g":"","@abtnode/cli":""},"children":[{"type":"text","value":"$ npm install -g @abtnode/cli\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"安装完成之后可以执行 "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"abtnode --version"}]},{"type":"text","value":" 查看当前的版本。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"install-vscode","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#install-vscode","ariaLabel":"install vscode permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Install VSCode"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"虽然有很多编辑器/IDE, 但是我们推荐使用 "},{"type":"element","tagName":"a","properties":{"href":"https://code.visualstudio.com/"},"children":[{"type":"text","value":"VS Code"}]},{"type":"text","value":", VS Code 应该是 JavaScript 生态中最好用的编辑器了,如果是开发 JavaScript/Node.js 应用,开箱即用。"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"安装也非常简单,官网提供了 Windows/Mac/常用的 Linux 发行版下的安装包,一键点击即可安装: "},{"type":"element","tagName":"a","properties":{"href":"https://code.visualstudio.com/#alt-downloads"},"children":[{"type":"text","value":"https://code.visualstudio.com/#alt-downloads"}]}]}],"data":{"quirksMode":false}}}}},"pageContext":{"site":{"title":"ABT Node","description":"ABT Node Documentation","siteUrl":"https://docs.arcblock.io","logoUrl":"/abtnode/","sidebarWidth":360,"disableI18n":false,"showGetStarted":true,"defaultBanner":"/abtnode/og-banner.png"},"id":"0fc7f4f2-50de-5138-a9d3-c7a42e231422","language":"zh","locale":"zh","languages":[{"value":"en","text":"English"},{"value":"zh","text":"简体中文"}],"headings":[{"value":"Install Node.js","depth":2},{"value":"Install nvm","depth":3},{"value":"安装 LTS 版本 Node.js","depth":3},{"value":"Install ABT Node","depth":2},{"value":"Install VSCode","depth":2}],"navItems":[{"group":"/home/runner/work/abtnode-docs/abtnode-docs/src","title":"ABT Node","priority":999,"link":"/"}],"version":"v0.2.20","official":true,"originalPath":"/zh/developer/config-dev-env","sidebarContent":[{"url":null,"title":null,"pages":[{"title":"ABT Node 文档","path":"/zh/"}]},{"url":"/zh/introduction","title":"节点入门","pages":[{"title":"节点功能概览","path":"/zh/introduction/abtnode-overview"},{"title":"如何获取 ABT 节点","path":"/zh/introduction/abtnode-setup"},{"title":"配置并启动 ABT 节点","path":"/zh/introduction/abtnode-access"}]},{"url":"/zh/marketplace","title":"应用市场","pages":[{"title":"查找和安装 Blocklet","path":"/zh/marketplace/find-and-install"},{"title":"升级或降级 Blocklet","path":"/zh/marketplace/upgrade-downgrade"}]},{"url":"/zh/blocklet","title":"应用管理","pages":[{"title":"基本管理操作","path":"/zh/blocklet/basic-operations"},{"title":"环境变量管理","path":"/zh/blocklet/environments"},{"title":"核心 Blocklets","path":"/zh/blocklet/core-blocklets"}]},{"url":"/zh/router","title":"路由管理","pages":[{"title":"什么是路由","path":"/zh/router/what-is-router"},{"title":"路由的基本用法","path":"/zh/router/basic-usage"},{"title":"给站点绑定域名以及启用 SSL","path":"/zh/router/bind-domain-and-ssl"},{"title":"localhost 证书","path":"/zh/router/certificates-for-localhost"}]},{"url":"/zh/deployment","title":"生产环境指南","pages":[{"title":"部署最佳实践","path":"/zh/deployment/best-practice"},{"title":"在 AWS 上部署","path":"/zh/deployment/from-aws-ami"},{"title":"运行在反向代理","path":"/zh/deployment/behind-reverse-proxy"},{"title":"在 Docker 中运行","path":"/zh/deployment/run-in-docker"}]},{"url":"/zh/misc","title":"其他功能","pages":[{"title":"节点配置","path":"/zh/misc/node-settings"},{"title":"成员管理","path":"/zh/misc/member-management"},{"title":"GraphQL 试验台","path":"/zh/misc/graphql-console"}]},{"url":"/zh/developer","title":"开发者指南","pages":[{"title":"配置开发环境","path":"/zh/developer/config-dev-env"},{"title":"ABT 节点 cli 工具","path":"/zh/developer/abtnode-cli"},{"title":"节点配置","path":"/zh/developer/configuration"},{"title":"节点存储目录详解","path":"/zh/developer/storage-structure"},{"title":"Blocklet 规范","path":"/zh/developer/blocklet-spec"},{"title":"创建静态 Blocklets","path":"/zh/developer/static-blocklets"},{"title":"创建 DApp Blocklets","path":"/zh/developer/dapp-blocklets"},{"title":"Blocklet 生命周期钩子","path":"/zh/developer/blocklet-hooks"},{"title":"打包 Blocklet","path":"/zh/developer/bundle-blocklets"},{"title":"发布 Blocklet","path":"/zh/developer/publish-blocklets"},{"title":"Blocklet 仓库","path":"/zh/developer/blocklet-registry"},{"title":"在 Codespaces 中开发 Blocklets","path":"/zh/developer/blocklet-codespaces"},{"title":"为 Blocklet 配置 Auth Service","path":"/zh/developer/auth-service"},{"title":"可组合的 Blocklet","path":"/zh/developer/composable-blocklet"},{"title":"Docker 镜像源列表","path":"/zh/developer/docker-registry"}]}],"communityPath":"https://community.arcblockio.cn","githubUrl":"https://github.com/ArcBlock/abtnode-docs/tree/master/src/developer/config-dev-env/index.zh.md"}},"staticQueryHashes":["1358860651","1619896071","1812186216","2194038815"]}