Closed TLHorse closed 4 years ago
@TLHorse hexo clean
了没有?
@TLHorse
hexo clean
了没有?
都clean了无数遍了~ 是不是因为有些库没有安装?
@TLHorse 也有可能是浏览器缓存的问题,或者你之前安装了什么其他的Hexo插件引起的。请检查根目录下的package.json并尝试删除node_modules
和npm install
。
你的意思是将node_modules
文件夹手动删除,然后再cd
到博客目录,然后npm install
?你确定我的博客会没事吗?
另外,刚才强刷了localhost:4000
的缓存,没有解决问题。:(
cd到博客目录 -> 将node_modules文件夹手动删除 -> npm install 你要是觉着可能有事你就备份一份
cd到博客目录 -> 将node_modules文件夹手动删除 -> npm install 你要是觉着可能有事你就备份一份
我刚才试了一遍,结果还是没解决问题。。。我只想呵呵。。。 是时候放弃这个主题吗。。。可我不想放弃欸。。。还有什么办法吗?
安装中倒是有一段错误提示,不知道能不能说明问题:
gyp WARN EACCES current user ("MaTianlai") does not have permission to access the dev dir "/var/root/Library/Caches/node-gyp/12.16.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/Users/MaTianlai/Documents/TLHorse_Blog/node_modules/hexo-abbrlink/node_modules/fsevents/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/MaTianlai/Documents/TLHorse_Blog/node_modules/hexo-abbrlink/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/MaTianlai/Documents/TLHorse_Blog/node_modules/hexo-abbrlink/node_modules/fsevents
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
> fsevents@1.2.12 install /Users/MaTianlai/Documents/TLHorse_Blog/node_modules/hexo-prism-plugin/node_modules/fsevents
> node-gyp rebuild
gyp WARN EACCES current user ("MaTianlai") does not have permission to access the dev dir "/var/root/Library/Caches/node-gyp/12.16.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/Users/MaTianlai/Documents/TLHorse_Blog/node_modules/hexo-prism-plugin/node_modules/fsevents/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/MaTianlai/Documents/TLHorse_Blog/node_modules/hexo-prism-plugin/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/MaTianlai/Documents/TLHorse_Blog/node_modules/hexo-prism-plugin/node_modules/fsevents
gyp ERR! node -v v12.16.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
> ejs@2.7.4 postinstall /Users/MaTianlai/Documents/TLHorse_Blog/node_modules/ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)
> inferno@7.4.2 postinstall /Users/MaTianlai/Documents/TLHorse_Blog/node_modules/inferno
> opencollective-postinstall
Thank you for using inferno!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/inferno/donate
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/hexo-abbrlink/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/hexo-prism-plugin/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
不过我发现这个问题是时有时无的,比如到我的作文category里就没有:
但是到计算机category理就会出现问题:
@TLHorse 对照这里排查下:https://github.com/ppoffice/hexo-theme-icarus/blob/site/package.json
hexo-algolia
和hexo-filter-github-emojis
不用
好像都全着呢。我的package.json:
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "4.2.0"
},
"dependencies": {
"bulma-stylus": "^0.8.0",
"hexo": "^4.0.0",
"hexo-abbrlink": "^2.0.5",
"hexo-component-inferno": "^0.2.4",
"hexo-deployer-git": "^2.1.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-index": "^1.0.0",
"hexo-generator-search": "^2.4.0",
"hexo-generator-tag": "^1.0.0",
"hexo-prism-plugin": "^2.3.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-inferno": "^0.1.3",
"hexo-renderer-marked": "^2.0.0",
"hexo-renderer-stylus": "^1.1.0",
"hexo-server": "^1.0.0",
"hexo-wordcount": "^6.0.1",
"inferno": "^7.4.2",
"inferno-create-element": "^7.4.2"
}
}
注:wordcount和abbrlink是我自己加的
我怎么改都不行,气死我了 你说这跟暗黑模式有关系吗?
@TLHorse 把这个去掉试试"hexo-prism-plugin": "^2.3.0",
@TLHorse 把这个去掉试试
"hexo-prism-plugin": "^2.3.0",
我运行了一下npm uninstall hexo-prism-plugin
,果然成功了!
我分析的原因是,hexo-prism-plugin
库是一个给代码上色的库,但是它把网站里所有文字都变成了代码。只要把它去掉就不会出现黑块(代码块)了。
我从matery主题换成icarus后,先下载了几个依赖,然后设了一下configyml,之后网站变成:
文字之间有许多奇怪的黑块,还有许多黑线,恶心得不行。我哪里配置错了?求教 _config.yml: