Closed ChinaNuke closed 3 years ago
能否贴一下操作系统和 npm 版本,预期中安装 node-canvas 时应该会拉取 prebuilt
$ npm version
{
'hexo-site': '0.0.0',
npm: '6.14.5',
ares: '1.16.0',
brotli: '1.0.7',
cldr: '37.0',
http_parser: '2.9.3',
icu: '67.1',
llhttp: '2.0.4',
modules: '72',
napi: '6',
nghttp2: '1.41.0',
node: '12.18.2',
openssl: '1.1.1g',
tz: '2019c',
unicode: '13.0',
uv: '1.38.0',
v8: '7.8.279.23-node.39',
zlib: '1.2.11'
}
在 Windows 下没能重现问题,安装 hexo-hanzi 时应会提示
> canvas@2.6.1 install ...\node_modules\canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
[canvas] Success: "...\node_modules\canvas\build\Release\canvas.node" is installed via remote
能否尝试删除 node_modules
目录后重新 npm install
,并附上完整 log 和 package.json?
删除node_modules
目录后重新npm install
后的log如下:
npm WARN deprecated hexo-bunyan@2.0.0: Please see https://github.com/hexojs/hexo
-bunyan/issues/17
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has bee
n deprecated because it extends the now deprecated request package, see https://
github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://git
hub.com/request/request/issues/3142
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprec
ated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#dep
recated
> canvas@2.6.1 install E:\MyBlog\node_modules\canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
[canvas] Success: "E:\MyBlog\node_modules\canvas\build\Release\canvas.node" is i
nstalled via remote
> ejs@2.7.4 postinstall E:\MyBlog\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 E:\MyBlog\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 notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN notsup Unsupported engine for han-css@3.3.0: wanted: {"node":"0.12.x"}
(current: {"node":"12.18.2","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: han-css@3.3.0
added 571 packages from 583 contributors and audited 574 packages in 72.632s
13 packages are looking for funding
run `npm fund` for details
found 2 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
是不是因为这个Unsupported engine for han-css@3.3.0: wanted: {"node":"0.12.x"} (current: {"node":"12.18.2","npm":"6.14.5"})
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.1"
},
"dependencies": {
"bulma-stylus": "^0.8.0",
"hexo": "^4.2.1",
"hexo-component-inferno": "^0.4.0",
"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-tag": "^1.0.0",
"hexo-hanzi": "^0.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",
"inferno": "^7.4.2",
"inferno-create-element": "^7.4.2"
}
}
看样子是装上了?还是没装上?
$ npm list |grep han
| | | +-- domhandler@3.0.0
| | | | `-- domhandler@3.0.0 deduped
+-- hexo-hanzi@0.3.0
| `-- node-han-css@0.3.0
| +-- han-css@3.3.0
| | +-- @babel/plugin-transform-shorthand-properties@7.10.4
| | +-- finalhandler@1.1.2
这次运行hexo g
已经没有报错了,但是网页上没有效果。
hexo g
没有报错说明安装成功了,没有效果的话尝试下 hexo clean && hexo g
试过了,并没有效果: 请问这些步骤需要做吗?
请问这些步骤需要做吗?
需要的。
主题布局通常在 themes/主题/layout
下,比如默认主题的头部代码在 themes/landscape/layout/_partial/head.ejs
。
使用
npm install --save hexo-hanzi
命令无法安装成功,提示如下:执行
hexo g
时提示如下:不是很懂node,请问如何正常安装?