hexo部署到github时,提示typeError [ERR_INVALID_ARG_TYPE]: The “mode“ argument must be integer. Receive…

本文首发于博客冰山一树Sankey,去博客浏览效果更好。

一. 错误情况

在部署部署博客时,遇到这个错误,

$ hexo d
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
TypeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Received an instance of Object
at copyFile (fs.js:2040:10)
at tryCatcher (D:\HexoBlog\node_modules\bluebird\js\release\util.js:16:23)
at ret (eval at makeNodePromisifiedEval (C:\Users\27532\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\promisify.js:184:12), <anonymous>:13:39)
at D:\HexoBlog\node_modules\hexo-fs\lib\fs.js:144:39
at tryCatcher (D:\HexoBlog\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:517:31)
at Promise._settlePromise (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:574:18)
at Promise._settlePromise0 (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:619:10)
at Promise._settlePromises (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:699:18)
at Promise._fulfill (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:643:18)
at Promise._resolveCallback (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:437:57)
at Promise._settlePromiseFromHandler (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:529:17)
at Promise._settlePromise (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:574:18)
at Promise._settlePromise0 (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:619:10)
at Promise._settlePromises (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:699:18)
at Promise._fulfill (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:643:18)
at Promise._resolveCallback (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:437:57)
at Promise._settlePromiseFromHandler (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:529:17)
at Promise._settlePromise (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:574:18)
at Promise._settlePromise0 (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:619:10)
at Promise._settlePromises (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:699:18)
at Promise._fulfill (D:\HexoBlog\node_modules\bluebird\js\release\promise.js:643:18)

二. 解决方法

查阅相关文章得知,是node版本过高导致的

查看了我的版本号

$ hexo -v
hexo: 3.9.0
hexo-cli: 4.3.0
os: win32 10.0.19042
node: 14.17.5
v8: 8.4.371.23-node.76
uv: 1.41.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.17.2
modules: 83
nghttp2: 1.42.0
napi: 8
llhttp: 2.1.3
openssl: 1.1.1k
cldr: 39.0
icu: 69.1
tz: 2021a
unicode: 13.0

hexo 版本才3.9.0,

而node 版本已经是14.17.5了

更换版本

Releases · coreybutler/nvm-windows (github.com)下载nvm

安装

(5条消息) Node版本的升级和降级之node版本管理工具nvm_Pioneer-CSDN博客_nvm升级node版本

windows如何把已安装的nodejs高版本降级为低版本(图文教程)_node.js_脚本之家 (jb51.net)

三. 附常用nvm命令

查看安装过的node版本 nvm list

安装某个版本nvm install <version>

使用某个版本 nvm use<version>

载某个node版本 nvm uninstall <version>

如果出现乱码

更改了cmd的权限成功解决问题,以管理员运行cmd窗口,再输入nvm use 12.14.0解决问题

再运行 hexo d 成功解决

hexo部署到github时,提示typeError [ERR_INVALID_ARG_TYPE] The “mode“ argument must be integer. Receive的更多相关文章

  1. Hexo部署到GitHub出现spawn ENOENT的解决办法

    最近用Hexo博客部署到GitHub时出现了这如下的错误: Error: spawn ENOENT at errnoException (child_process.js:980:11) at Pro ...

  2. 用nodejs安装hexo,将hexo部署到github

    跌跌撞撞写这篇博文,希望下一篇可以好点 运行环境:最新版本的nodejs + git 安装好nodejs 和 git ,注册好github账号,新建仓库****.github.io(****为gith ...

  3. WebService部署服务器调试时提示 “测试窗体只能用于来自本地计算机的请求”解决方法

    原因:没有开启服务器访问权限! 解决方法: 在web.config的<system.web></system.web>中加入如下配置节内容即可解决 <webService ...

  4. Hexo 博客部署到 GitHub

    本文简单记录了一下把 Hexo 部署到 GitHub 上的过程,也是搭建静态博客最常用的一种方式. 前面写了关于如何把 Hexo 安装在树莓派上的教程,但树莓派毕竟是连着自己的家的路由器,万一哪天网断 ...

  5. Linux下使用 github+hexo 搭建个人博客02-hexo部署到Github Pages

    之前的这篇文章<Linux下使用 github+hexo 搭建个人博客01-hexo搭建>,相信大家都知道怎么搭建 hexo ,怎么切换主题,并且完成了一篇博文的创建,以及 MarkDow ...

  6. Hexo 博客 github.io MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  7. 优化hexo访问速度-将hexo部署到云主机VPS

    写在开始 一开始将自己hexo部署到github,结果发现打开页面速度有点慢,然后又将其同时部署到coding,实现双线路访问,国内解析记录到coding,国外解析到github,这样确实网站的速度能 ...

  8. 使用Github SSH Key来避免Hexo部署时输入账户密码

    博客原文:http://fengyao.me/2016/04/10/use-git-ssh-key-carry-hexo-deploy/ 前言 当hexo使用https方式连接Github时,每次执行 ...

  9. 史上最详细“截图”搭建Hexo博客并部署到Github

    http://jingyan.baidu.com/article/d8072ac47aca0fec95cefd2d.html 大家也搭建过博客,很多时候,按着教程来做就可以了,但是我当时为了搭建Hex ...

随机推荐

  1. NOIP PJ/CSP-J 题目选做

    1. luoguP7074 [CSP-J2020] 方格取数 2. luoguP5662 [CSP-J2019] 纪念品 3. luoguP2671 [NOIP2015 普及组] 求和 4. luog ...

  2. Spring专题2: DI,IOC 控制反转和依赖注入

    合集目录 Spring专题2: DI,IOC 控制反转和依赖注入 https://docs.spring.io/spring/docs/2.5.x/reference/aop.html https:/ ...

  3. C++学习Day 1

    c++的函数需要声明才能再写他的定义,声明可以写多次,如果执行在main之前可以不写,全写不会犯错,现在看好像c++的函数定义里没有out,也没有变量的public和private(后面有再改) 声明 ...

  4. 布客&#183;ApacheCN 编程/大数据/数据科学/人工智能学习资源 2020.4

    公告 我们的机器学习群(915394271)正式改名为财务提升群,望悉知. 请关注我们的公众号"ApacheCN",回复"教程/路线/比赛/报告/技术书/课程/轻小说/漫 ...

  5. ExcelPackage 使用說明

    1.使用方法 public IActionResult Excel() { string sWebRootFolder = _hostingEnvironment.WebRootPath; strin ...

  6. java实现以docx格式导出

    直接上代码:Map<String, Object> dataMap = afterLoanReportService.exportReport(startDate, endDate);// ...

  7. ssh中“Host key verification failed.“的解决方案

    SSH连接的时候Host key verification failed. ➜ ~ ssh root@192.168.1.88 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ...

  8. 广播接收者案例_ip拨号器

    (1)定义一个类继承BroadCastReceiver public class OutGoingCallReceiver extends BroadcastReceiver { //当接收到外拨电话 ...

  9. 匿名内部类不能访问外部类方法中的局部变量,除非变量被声明为final类型

    1. 这里所说的"匿名内部类"主要是指在其外部类的成员方法内定义,同时完成实例化的类,若其访问该成员方法中的局部变量,局部变量必须要被final修饰.2. 原因是编译程序实现上的困 ...

  10. iOS 小技巧总结

    1.获取准确的app启动所需时间 应用启动时间长短对用户第一次体验至关重要,同时系统对应用的启动.恢复等状态的运行时间也有严格要求,在应用超时的情况下系统会直接关闭应用.以下是几个常见场景下系统对Ap ...