前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >mark-text开发环境搭建启动

mark-text开发环境搭建启动

作者头像
阿超
发布2023-07-08 15:38:53
2640
发布2023-07-08 15:38:53
举报
文章被收录于专栏:快乐阿超

没有目的,就做不成任何事情;目的渺小,就做不成任何大事——狄德罗

IDEA的安装就不多赘述了

代码语言:javascript
复制
achaodeMacBook-Pro:~ achao$ brew install --cask intellij-idea
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/api/cask.jws.json
#=#=#                                                                          
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-cask/2b3de06
Already downloaded: /Users/achao/Library/Caches/Homebrew/downloads/03208b267695d41517fe798d19f1a1d3f0ecc722ebac64499965e6529b228d13--intellij-idea.rb
==> Downloading https://download.jetbrains.com/idea/ideaIU-2023.1.3-aarch64.dmg
==> Downloading from https://download.jetbrains.com.cn/idea/ideaIU-2023.1.3-aarc
######################################################################### 100.0%
==> Installing Cask intellij-idea
==> Moving App 'IntelliJ IDEA.app' to '/Applications/IntelliJ IDEA.app'
🍺  intellij-idea was successfully installed!
achaodeMacBook-Pro:~ achao$ 

我们打开idea,clone项目

https://github.com/VampireAchao/marktext.git

来到项目目录终端下执行

按照说明里我们进行安装对应版本的node以及yarn以及node-gyp

代码语言:javascript
复制
chaodeMacBook-Pro:~ achao$ nvm install 16
Downloading and installing node v16.20.1...
Downloading http://mirrors.cloud.tencent.com/nodejs-release//v16.20.1/node-v16.20.1-darwin-arm64.tar.xz...
######################################################################### 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v16.20.1 (npm v8.19.4)
achaodeMacBook-Pro:~ achao$ npm i yarn -g

added 1 package, and audited 2 packages in 4s

found 0 vulnerabilities
achaodeMacBook-Pro:~ achao$ yarn -v
1.22.19
192:~ achao$ npm install -g node-gyp

added 126 packages, and audited 127 packages in 17s

17 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
192:~ achao$ node-gyp -v
v9.4.0

然后是python,我们安装pyenv

代码语言:javascript
复制
192:~ achao$ brew install pyenv
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/api/formula.jws.jso
######################################################################### 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/api/cask.jws.json
######################################################################### 100.0%
==> Fetching dependencies for pyenv: m4, autoconf, ca-certificates, openssl@3, pkg-config and readline
==> Fetching m4
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/m4-1.4.19.a
######################################################################### 100.0%
==> Fetching autoconf
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/autoconf-2.
######################################################################### 100.0%
==> Fetching ca-certificates
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/ca-certific
######################################################################### 100.0%
==> Fetching openssl@3
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/openssl%403
######################################################################### 100.0%
==> Fetching pkg-config
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/pkg-config-
######################################################################### 100.0%
==> Fetching readline
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/readline-8.
######################################################################### 100.0%
==> Fetching pyenv
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/pyenv-2.3.2
######################################################################### 100.0%
==> Installing dependencies for pyenv: m4, autoconf, ca-certificates, openssl@3, pkg-config and readline
==> Installing pyenv dependency: m4
==> Pouring m4-1.4.19.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/m4/1.4.19: 13 files, 742.2KB
==> Installing pyenv dependency: autoconf
==> Pouring autoconf-2.71.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/autoconf/2.71: 71 files, 3.2MB
==> Installing pyenv dependency: ca-certificates
==> Pouring ca-certificates-2023-05-30.arm64_ventura.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
🍺  /opt/homebrew/Cellar/ca-certificates/2023-05-30: 3 files, 216.1KB
==> Installing pyenv dependency: openssl@3
==> Pouring openssl@3-3.1.1_1.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/openssl@3/3.1.1_1: 6,495 files, 28.4MB
==> Installing pyenv dependency: pkg-config
==> Pouring pkg-config-0.29.2_3.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/pkg-config/0.29.2_3: 11 files, 676KB
==> Installing pyenv dependency: readline
==> Pouring readline-8.2.1.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/readline/8.2.1: 50 files, 1.7MB
==> Installing pyenv
==> Pouring pyenv-2.3.21.arm64_ventura.bottle.tar.gz
🍺  /opt/homebrew/Cellar/pyenv/2.3.21: 1,083 files, 3.3MB
==> Running `brew cleanup pyenv`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
192:~ achao$ pyenv -v
pyenv 2.3.21

初始化pyenv

添加到 ~/.bash_profile :

代码语言:javascript
复制
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile

然后配置镜像

代码语言:javascript
复制
echo 'export PYTHON_BUILD_MIRROR_URL="https://mirrors.huaweicloud.com/python/"' >> ~/.bash_profile

然后安装python,这里不知道镜像生效没有,虽然确实设置了

代码语言:javascript
复制
achaodeMacBook-Pro:~ achao$ echo $PYTHON_BUILD_MIRROR_URL
https://mirrors.huaweicloud.com/python/
achaodeMacBook-Pro:~ achao$ pyenv install 3.10.4
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.10.4.tar.xz...
-> https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tar.xz
Installing Python-3.10.4...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/achao/.pyenv/versions/3.10.4/lib/python3.10/lzma.py", line 27, in <module>
    from _lzma import *
ModuleNotFoundError: No module named '_lzma'
WARNING: The Python lzma extension was not compiled. Missing the lzma lib?
Installed Python-3.10.4 to /Users/achao/.pyenv/versions/3.10.4
achaodeMacBook-Pro:~ achao$ pyenv global 3.10
achaodeMacBook-Pro:~ achao$ python -V
Python 3.10.4

然后是C++编译器xcode

这里安装太慢了,我们停止一下,配置一下镜像

代码语言:javascript
复制
192:~ achao$ yarn config set -g registry http://mirrors.cloud.tencent.com/npm/
yarn config v1.22.19
success Set "http://mirrors.cloud.tencent.com/npm/" to true.
✨  Done in 0.01s.

然后点击右下角Run 'yarn install'发现没有识别到

我们配置下ideayarn环境点击ok

此时依赖开始安装,结果报错

说找不到vscode。。。

我们打开代理再试试

代码语言:javascript
复制
achaodeMacBook-Pro:marktext achao$ yarn install
yarn install v1.22.19
$ node .electron-vue/preinstall.js
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
warning file-icons@2.1.47: The engine "atom" appears to be invalid.
warning atom-fs@0.2.1: The engine "atom" appears to be invalid.
warning mapped-disposable@1.0.3: The engine "atom" appears to be invalid.
[3/4] 🔗  Linking dependencies...
warning " > eslint-config-standard@16.0.3" has incorrect peer dependency "eslint@^7.12.1".
warning " > eslint-config-standard@16.0.3" has incorrect peer dependency "eslint-plugin-promise@^4.2.1 || ^5.0.0".
[4/4] 🔨  Building fresh packages...
$ node .electron-vue/postinstall.js && yarn run rebuild && yarn run lint:fix
yarn run v1.22.19
$ electron-rebuild -f
⠇ Building module: ced, Completed: 0  CXX(target) Release/obj.target/compact_enc_det/vendor/compact_enc_det/compact_enc_det/compact_enc_det.o
⠦ Building module: ced, Completed: 0  CXX(target) Release/obj.target/compact_enc_det/vendor/compact_enc_det/compact_enc_det/compact_enc_det_hint_code.o
⠇ Building module: ced, Completed: 0  CXX(target) Release/obj.target/compact_enc_det/vendor/compact_enc_det/util/encodings/encodings.o
⠹ Building module: ced, Completed: 0  CXX(target) Release/obj.target/compact_enc_det/vendor/compact_enc_det/util/languages/languages.o
  LIBTOOL-STATIC Release/compact_enc_det.a
⠏ Building module: ced, Completed: 0  CXX(target) Release/obj.target/ced/ced.o
⠋ Building module: ced, Completed: 0  SOLINK_MODULE(target) Release/ced.node
⠹ Building module: fontmanager-redux, Completed: 1  CXX(target) Release/obj.target/fontmanager/src/FontManager.o
⠧ Building module: fontmanager-redux, Completed: 1  CXX(target) Release/obj.target/fontmanager/src/FontManagerMac.o
⠹ Building module: fontmanager-redux, Completed: 1  SOLINK_MODULE(target) Release/fontmanager.node
⠴ Building module: native-keymap, Completed: 3  CXX(target) Release/obj.target/keymapping/src/string_conversion.o
⠧ Building module: native-keymap, Completed: 3  CXX(target) Release/obj.target/keymapping/src/keymapping.o
⠋ Building module: native-keymap, Completed: 3  CXX(target) Release/obj.target/keymapping/src/keyboard_mac.o
⠦ Building module: native-keymap, Completed: 3  SOLINK_MODULE(target) Release/keymapping.node
✔ Rebuild Complete
✨  Done in 50.71s.
yarn run v1.22.19
$ eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src test
✨  Done in 5.94s.
✨  Done in 108.28s.

成功执行!咱们启动下项目

代码语言:javascript
复制
yarn dev
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-07-02,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档