其他分享
首页 > 其他分享> > hexo豆瓣卡片安裝遇到的坑

hexo豆瓣卡片安裝遇到的坑

作者:互联网

hexo豆瓣卡片安裝遇到的坑

軟件升級版本前

系統版本:Ubuntu 18.04.1

node版本: v8.10.0

npm版本: v3.5.2

 

安裝豆瓣卡片

sudo npm install hexo-douban-card --save

 

提示webpack警告
所以安裝webpack

sudo  npm install webpack@^4.4.0 --save

 

WARN engine semver@7.3.2: wanted: {“node”:”>=10”} (current: {“node”:”8.10.0”,”npm”:”3.5.2”loadDep:fsevents ▐ ╢████████████████████████████████░
調試發現還是有報錯

sudo npm install hexo-douban-card --save
hexo --debug

看了大概好像是權限的問題,SO給這個文件夾一樣的權限

ll hexo-douban-card
sudo chown -R  max.max hexo-douban-card/
ll hexo-douban-card

調試發現居然沒報錯了

hexo --debug 

那趕緊發佈文章看看

hexo n "xxx"
hexo g
hexo s

 

嗯,正常了!!
但是我想多了,就在我想再發佈一篇文章時,又報錯了,這次又是不一樣的錯誤!(錯誤沒複製到,就把框關掉了。無法復現了)
所以我只能卸載

sudo npm uninstall hexo-douban-card --save

 

我嘗試了一下不安裝devDependencies 里面的包看看

sudo npm install --production

 

解析

npm install will install both “dependencies” and “devDependencies“
npm install –production will only install “dependencies“
npm install –dev will only install “devDependencies“

 

升級npm

sudo npm install -g n
sudo n stable

 

配置環境變量

export PATH=/usr/local/bin/node:$PATH
export 

查看版本

#node -v
v12.18.3
#npm -v
v8.10.0

重新安裝hexo-douban-card

sudo npm install hexo-douban-card --save
hexo g -w

 

報錯。。。。。
Template render error: (unknown path) [Line 3, Column 25]
unknown block tag: dplayer
嗯,應該是dplayer插件的問題
點開插件列表,發現少了dplayer 插件,SO安裝它

sudo npm install hexo-tag-dplayer

重新生成

hexo g -w

 

NICE,沒有報錯了,繼續發佈,也正常,網頁雲可以正常訪問!!!!總算救回來了。。。。。

TRANSLATE with x English
Arabic Hebrew Polish
Bulgarian Hindi Portuguese
Catalan Hmong Daw Romanian
Chinese Simplified Hungarian Russian
Chinese Traditional Indonesian Slovak
Czech Italian Slovenian
Danish Japanese Spanish
Dutch Klingon Swedish
English Korean Thai
Estonian Latvian Turkish
Finnish Lithuanian Ukrainian
French Malay Urdu
German Maltese Vietnamese
Greek Norwegian Welsh
Haitian Creole Persian  
  TRANSLATE with COPY THE URL BELOW Back EMBED THE SNIPPET BELOW IN YOUR SITE Enable collaborative features and customize widget: Bing Webmaster Portal Back

标签:npm,douban,安裝,hexo,--,sudo,豆瓣,install
来源: https://www.cnblogs.com/suixinnan/p/15417300.html