1. 常规安全更新
1 2 3 4 5
| npm outdated
npm update
|
2. 深度更新
如果需要将 Hexo 或者插件升级到最新的版本,建议使用 npm-check-updates。
更新前,请务必进行一次 Git 提交,或者备份 _config.yml 和你的主题配置文件!!!
2.1 安装
1
| sudo npm install -g npm-check-updates
|
2.2 检查版本
注意要在 Hexo 根目录下运行:
在确认所有软件包的更新没有问题后,运行以下命令修改 package.json:
2.3 软件包更新
最后执行软件包安装:
如果输出以下报错:
1 2 3 4 5 6 7
| npm warn install-scripts 4 packages had install scripts blocked because they are not covered by allowScripts: npm warn install-scripts [email protected] (postinstall: npm run build:highlight) npm warn install-scripts [email protected] (postinstall: npm run build:highlight) npm warn install-scripts [email protected] (postinstall: npm run build:highlight) npm warn install-scripts [email protected] (postinstall: npm run build:highlight) npm warn install-scripts npm warn install-scripts Run `npm install-scripts ls` to review, or `npm install-scripts approve <pkg>` to allow.
|
请进行手动审批:
1
| npm install-scripts approve hexo-util
|