视频加载失败

fuwari博客(研究2天终于研究成功)

925 字
5 分钟
fuwari博客(研究2天终于研究成功)
fuwari博客(研究2天终于研究成功)

不是你网络的问题,也不是 Stylus 包被彻底下架,而是刚刚发生了一个安全事件 :npm 因为发现 Stylus 包中存在恶意代码,于 2025 年 7 月 23 日凌晨左右 (UTC 时间)将所有 Stylus 版本从注册表中移除了,并发布了一个占位版本 0.0.1‑security 来阻止继续安装 Hacker News+1npm+1。

import type {

ExpressiveCodeConfig,
LicenseConfig,
NavBarConfig,
ProfileConfig,
SiteConfig,

} from ”./types/config”;

import { LinkPreset } from ”./types/config”;

export const siteConfig: SiteConfig = {

title: "码境Code Realm",
subtitle: "爱你一生",
lang: "zh_CN", // 'en', 'zh_CN', 'zh_TW', 'ja', 'ko', 'es', 'th'
themeColor: {
hue: 250, // Default hue for the theme color, from 0 to 360. e.g. red: 0, teal: 200, cyan: 250, pink: 345
fixed: false, // Hide the theme color picker for visitors
},
banner: {
enable: true,
src: "https://img.xn--ohqu9y07ujpb.dpdns.org/file/1754446851075_banner.DBvCl2Qg_ZBX2hI.webp", // Relative to the /src directory. Relative to the /public directory if it starts with '/'
position: "center", // Equivalent to object-position, only supports 'top', 'center', 'bottom'. 'center' by default
credit: {
enable: true, // Display the credit text of the banner image
text: "Pixiv @chokei", // Credit text to be displayed
url: "https://www.pixiv.net/users/175341486", // (Optional) URL link to the original artwork or artist's page
},
},
toc: {
enable: true, // Display the table of contents on the right side of the post
depth: 2, // Maximum heading depth to show in the table, from 1 to 3
},
favicon: [
{
src: "https://e5bf5984.cloudflare-imgbed-csc.pages.dev/file/1753414862012_0_b67f5a87763bc15d58d147d89ff8823c_1753414687712.webp", // Path of the favicon, relative to the /public directory
theme: "light", // (Optional) Either 'light' or 'dark', set only if you have different favicons for light and dark mode
sizes: "32x32", // (Optional) Size of the favicon, set only if you have favicons of different sizes
},
],

};

export const navBarConfig: NavBarConfig = {

links: [
LinkPreset.Home,
LinkPreset.Archive,
LinkPreset.About,
{
name: "友链",
url: "https://github.com/saicaca/fuwari", // Internal links should not include the base path, as it is automatically added
external: false, // Show an external link icon and will open in a new tab
},
{
name: "统计",
url: "https://cloud.umami.is/share/azr29Ow6KU9YfL2U/kejidao.ggff.net", // Internal links should not include the base path, as it is automatically added
external: true, // Show an external link icon and will open in a new tab
},
{
name: "GitHub",
url: "https://github.com/saicaca/fuwari", // Internal links should not include the base path, as it is automatically added
external: true, // Show an external link icon and will open in a new tab
},
],

};

export const profileConfig: ProfileConfig = {

avatar: "assets/images/demo-tx.jpg", // Relative to the /src directory. Relative to the /public directory if it starts with '/'
name: "码境Code Realm",
bio: "Protect What You Love./爱你所爱!",
links: [
{
name: "YouTube",
icon: "fa6-brands:youtube", // Visit https://icones.js.org/ for icon codes
// You will need to install the corresponding icon set if it's not already included
// `pnpm add @iconify-json/<icon-set-name>`
url: "https://www.youtube.com/@xs.903",
},
{
name: "QQ",
icon: "fa6-brands:qq",
url: "https://wpa.qq.com/msgrd?v=3&uin=584524731&site=qq&menu=yes",
},
{
name: "GitHub",
icon: "fa6-brands:github",
url: "https://github.com/wangai14/fuwari",
},
{
name: "B站",
icon: "fa6-brands:bilibili",
url: "https://space.bilibili.com/485156002?spm_id_from=333.1007.0.0",
},
],

};

export const licenseConfig: LicenseConfig = {

enable: true,
name: "CC BY-NC-SA 4.0",
url: "https://creativecommons.org/licenses/by-nc-sa/4.0/",

};

export const expressiveCodeConfig: ExpressiveCodeConfig = {

// Note: Some styles (such as background color) are being overridden, see the astro.config.mjs file.
// Please select a dark theme, as this blog theme currently only supports dark background color
theme: "github-dark",

};

✅ 2. 直接改成 GitHub 的未受污染源码#

项目正在与 npm 官方沟通恢复,你可以暂时从 GitHub 源安装: [code] json

复制编辑
"overrides": {
"stylus": "github:stylus/stylus#0.64.0"
}

[/code]

这会从最新的官方源码安装 Stylus,而不是经过 npm 注册表 Hacker NewsYarn。

✅ 1. 修改 package.json#

请按照以下方法将 stylus 的依赖改为 GitHub 源代码安装:

👉 找到 package.json 中的 stylus 依赖,替换成这样:#

[code] json

复制编辑
"dependencies": {
"stylus": "github:stylus/stylus#master"
}

[/code]

如果它是在 devDependencies 中,也一样替换。


✅ 2. 执行安装命令#

确保你已经安装 git,然后运行: [code] bash

复制编辑
npm install

[/code]

它会直接从 GitHub 上克隆并构建 Stylus 源码。


✅ 3. 可选:锁定某个提交(非 master)#

如果你不想用 master(主分支可能变动),可以锁定到具体发布版本: [code] json

复制编辑
"stylus": "github:stylus/stylus#0.54.8"

[/code]

你可以去这个页面查看所有发布 tag:
https://github.com/stylus/stylus/tags


💡 示例 package.json 段落(完整参考)#

[code] json

复制编辑
{
"name": "fuwari",
"version": "1.0.0",
"dependencies": {
"stylus": "github:stylus/stylus#0.54.8",
"some-other-package": "^1.2.3"
}
}

[/code]


❗️注意事项#

  • 你需要已安装 Git 命令行(否则 npm 无法拉取 GitHub 仓库)

  • 使用 GitHub 源安装的包不受 npm 自动审计保护,注意安全性

  • 若部署到 Vercel 或 CI/CD 平台,确保它们也能访问 GitHub(否则构建会失败)

支持与分享

如果这篇文章对你有帮助,欢迎分享给更多人或打赏支持!

打赏
fuwari博客(研究2天终于研究成功)
https://welcome4535.de5.net/posts/fuwari2/
作者
码境科技
发布于
2025-07-23
许可协议
CC BY-NC-SA 4.0
相关文章智能推荐
1
Fuwari静态博客搭建教程
建站你需要准备的东西 一个牛逼的脑子,支持并行运算至少两个单位以上的事件。遇到问题先思考,想不通就搜索,搜索不到就去和AI调情,不要上来就问问问 Git - Downloads (git-scm.com) :最牛逼的版本控制器,这里用于对Github进行操作,当然,你也可以尝试使用
2
【Hexo博客系列】No.1 搭建Hexo博客,快速简洁高效,零成本搭建个人博客:Hexo + GitHub Pages +
建站搭建Hexo博客,快速简洁高效,零成本搭建个人博客:Hexo + GitHub Pages + Cloudflare Pages 完整指南 本文详细介绍了如何使用Hexo框架搭建一个个人博客,并将其部署到GitHub Pages和Cloudflare Pages上。主要内容包括:
3
将Telegram channel变成博客/QQ空间说说/树洞/备忘录/情侣日常记录,cloudflare超好玩的新项目,超多好玩
建站✨ 特性与应用场景 将 Telegram Channel 转为微博客 作为个人备忘录 个人树洞,让你悄悄做一个有趣的人 支持多人同时发表动态 类似 QQ 空间的说说功能 个人专属微博 更多应用场景,欢迎探索! 🪧 演示 真实用户展示 面条实验室 : memo.miantiao.m
4
2025 Blog 的使用引导
建站该项目使用 Github App 管理项目内容,请保管好后续创建的 Private key ,不要上传到公开网上。 0. Fork 项目 请先 fork 我的项目到你自己的仓库中。后续我的更新,可以直接同步最新功能。 1. 安装 使用该项目可以先不做本地开发,直接部署然后配置环境
5
如何提高网站的SEO?
建站标题 即每个HTML head部分的 title 不要重名 如果你的标题是中文,请确保不要和任何知名事物关联上,比如不要叫 树叶博客 ,而是 叶树博客 。 搜索引擎对于知名事物给的权重很高,如果你还和这些知名事物重名,大众则很难搜索到你 使用英文标题 比如 AcoFork Blo
随机文章随机推荐

评论区

Profile Image of the Author
码境科技
Hello, I'm 码境科技。
公告
这里是码境科技的博客,分享建站、玩机与 AI 折腾。
分类
标签
最新动态
站点统计
文章
327
分类
44
标签
47
总字数
839,103
运行时长
0 天
最后活动
0 天前
站点信息
构建平台
Vercel
博客版本
Firefly v6.16.9
文章许可
CC BY-NC-SA 4.0
文章目录