博文

目前显示的是 六月, 2026的博文

Mac下运行npm install 报错

mac下部署一个next.js项目,运行 npm install 返回错误: npm error code EEXIST npm error syscall rename npm error path /Users/frank/.npm/_cacache/tmp/*** npm error dest /Users/frank/.npm/_cacache/content-v2/sha512/51/98/bcf984ff30b8130bd9ebae7d9777894162fd41ee5566b561df3dcb61008e53b7f0b52ee0dee837e6b42b49f9642877792c63856b292be4de83150272fbab npm error errno -13 npm error EACCES: permission denied, rename '/Users/frank/.npm/_cacache/tmp/***' -> '/Users/frank/.npm/_cacache/content-v2/sha512/51/98/bcf984ff30b8130bd9ebae7d9777894162fd41ee5566b561df3dcb61008e53b7f0b52ee0dee837e6b42b49f9642877792c63856b292be4de83150272fbab' npm error File exists: /Users/frank/.npm/_cacache/content-v2/sha512/51/98/bcf984ff30b8130bd9ebae7d9777894162fd41ee5566b561df3dcb61008e53b7f0b52ee0dee837e6b42b49f9642877792c63856b292be4de83150272fbab npm error Remove the existing file and try again, or run npm npm error with --force to overwrite files recklessly. npm error A complete log of this run can be found in: /Use...

通过dnshe.com注册免费域名并托管至cloudflare

图片
1、访问注册并登录 https://www.dnshe.com/?/ 2、注册免费域名 建议选择cc.cd域名 3、登录cloudflare并添加域名(选择 「连接域名」 ) 4、添加在dnshe.com上注册的免费域名 5、为域名选择免费计划 6、继续激活外部域名 7、获取并拷贝cloudflare提供的「名称服务器」 8、将cloudflare提供的服务器名称绑定在dnshe平台「域名管理」中的DNS服务器配置中 8、保存设置 9、返回至cloudflare点击「我一更新名称服务器」按钮 10、查看域名状态 (域名状态显示为 活动 即可) 11、部署完cmliu的edgetunnel科学上网服务的workers之后,正常登录 12、进入高手模式,并在「详细设置」中设置Host域名 不设置的话,使用cloudflare默认提供的域名无法正常更新服务器节点,而且也无法正常测速!

Mac/Ubuntu服务器拉取Github项目的最新版

之前未曾拉取过项目,第一次拉取: 1、先查看项目版本: git ls-remote - - tags https://github.com/zhangfanxp/zhengshu.git (tags前面是两个 - ) 命令行返回信息: d3eed8f7f685c6853de890c57d9ed93e3587b3b6 refs/tags/v3.1 edea535940ab90c210e0119af81a0b58ba5e605a refs/tags/v3.1^{} 2、拉取最新版或指定版本代码: git clone -b v3.1 https://github.com/ zhangfanxp/zhengshu.git ------------------------------------------------------------------------------------ 如果拉取过程中提示错误: Cloning into 'zhengshu'... remote: Enumerating objects: 816, done. remote: Counting objects: 100% (22/22), done. remote: Compressing objects: 100% (18/18), done. error: RPC failed; curl 18 Transferred a partial fileMiB/s   error: 2671 bytes of body are still expected fetch-pack: unexpected disconnect while reading sideband packet fatal: early EOF fatal: fetch-pack: invalid index-pack output 可以通过执行下面的命令后,再进行拉取: git config --global http.version HTTP/1.1 ================================================== 已经拉取过项目了,再拉取最新版本的代码: 1、查看本地代码与github上的差异是那些 git  pull 2、放弃所有已...

Ubuntu更新系统组件提示403 Fobidden错误

使用了中国国内镜像源更新系统组件提示403 Fobidden错误,只需要修改成ubuntu官方源即可。 1、修改 ubuntu.sources sudo vi /etc/apt/sources.list.d/ubuntu.sources -------------------------------------- Types: deb URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu Suites: noble noble-updates noble-backports Components: main restricted universe multiverse -------------------------------------- 把  URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu 改为: URIs: http://archive.ubuntu.com/ubuntu 保存并退出。 2、清理缓存 sudo apt clean 3、更新 sudo apt update 4、重启电脑 sudo  reboot

Mac下通过gh命令下载Github私有项目

 1、安装gh命令 brew install gh 查看gh版本 gh --version gh version 2.95.0 (2026-06-17) https://github.com/cli/cli/releases/tag/v2.95.0 2、登陆gh gh  auth  login 3、Where do you use GitHub? 选择GitHub.com > GitHub.com 4、What is your preferred protocol for Git operations on this host? 选择HTTPS > HTTPS 5、Authenticate Git with Github credentials? 选择Y 6、How would you like to authenticate GitHub CLI? Paste an authentication token > Paste an authentication token 7、把Github上的Token拷贝进来 ? Paste your authentication token: **************************************** 8、展示下面信息则表示登陆成功 - gh config set -h github.com git_protocol https ✓ Configured git protocol ✓ Logged in as zhangfanxp 9、下面直接拉取项目即可

Mac下部署llama.cpp推理框架

确定当前网络环境支持科学上网,并且使用下面的设置命令让命令行也具备翻墙网络环境: export https_proxy=http://127.0.0.1:7890 export http_proxy=http://127.0.0.1:7890 1、拉取llama.cpp项目 git clone https://github.com/ggml-org/llama.cpp.git && cd llama.cpp 2、创建虚拟环境 uv venv && source .venv/bin/activate 3、安装项目依赖库 uv pip install -r requirements.txt --index-strategy unsafe-best-match 4、下载模型 停止翻墙环境(重新打开一个命令行窗口) export HF_ENDPOINT=https://hf-mirror.com hf download Hcompany/Holo-3.1-4B 5、将模型转换为gguf格式 重新进入llama.cpp文件夹 python3 convert-hf-to-gguf.py ~/.cache/huggingface/hub/models--Hcompany--Holo-3.1-4B/snapshots/ f43fdd9d95493e04c813c2d765a764ba636fd899 --outfile ./ holo-4b.gguf python3 convert_hf_to_gguf.py ~/.cache/huggingface/hub/models--Hcompany-- Holo-3.1-4B /snapshots/ b63fb9bacd968a20b31d0c704b14429c0aad3a84 --outfile ./ holo-4b.gguf 6、启动llama.cpp服务   llama-server -m ./ holo-4b.gguf --port 8080 -c 2048 7、浏览器访问 http://127.0.0.1:8080 API地址: http://127.0.0.1:8080/v1 查看模型名称: http://localhost:8080/v1/models

Cloudflare的Workers部署Phaser开发的游戏项目

1、进入游戏项目根目录 2、安装wrangler npm install -D wrangler 3、浏览器先登录cloudflare账号 4、命令行登录cloudflare npx  wrangler  login 5、在项目路径下新增文件wrangler.jsonc {   "$schema": "./node_modules/wrangler/config-schema.json",   "name": " game2 ",   "compatibility_date": "2026-06-06",   "assets": {     "directory": "./dist",     "not_found_handling": "single-page-application"   } } 6、命令行部署 npm  run  build npx  wrangler  deploy 部署成功后,命令行会返回一个类似地址: https://game2.<你的账号>.workers.dev 7、浏览器登录cloudflare设置 game2 项目worker的绑定域名 填写绑定实际的域名,如:games.frank2000.uk 8、手机或PC电脑浏览器访问: games.frank2000.uk 即可

Mac下命令行中登录huggingface下载模型

1、在huggingface网站上创建并获取一个Token 2、命令行中运行登录命令 hf  auth  login 3、黏贴Token 4、检查是否登录成功 hf  auth  whoami 5、设置镜像站(可选) export HF_ENDPOINT=https://hf-mirror.com 取消翻墙,科学上网状态 ----------------------------------------------- 下载模型: hf  download  mlx-community/Hy-MT2-1.8B ++++++++++++++++++++++++++++ 如果提示错误: "/Users/ramey/Documents/Stock_Data/.venv/lib/python3.11/site-packages/huggingface_hub/file_download.py", line 585, in xet_get     with session.new_file_download_group( RuntimeError:  Task error: File reconstruction error: CAS Client Error: Format error: I/O error: error decoding response body 使用下面的命令下载模型: HF_HUB_DISABLE_XET = 1   hf  download  xxx/xxx