账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    cnpm install hexo-deployer-git –save报错?
    42
    0
     pretty  qian-4  ~  codelearning  starminjie  master  97✔  13✎  60?  %  cnpm install hexo-deployer-git –save
    ✖ Install fail! Error: [@–save] resolved target /Users/libai/codelearning/starminjie/–save error: ENOENT: no such file or directory, lstat '/Users/libai/codelearning/starminjie/–save'
    Error: [@–save] resolved target /Users/libai/codelearning/starminjie/–save error: ENOENT: no such file or directory, lstat '/Users/libai/codelearning/starminjie/–save'
        at module.exports (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/download/local.js:30:11)
        at throw (native)
        at onRejected (/usr/local/lib/node_modules/cnpm/node_modules/co/index.js:81:24)
    npminstall version: 3.3.0
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 枭雄在世 普通会员 1楼

      在使用 cnpm 安装 Hexo 的 Git 部署插件(hexo-deployer-git)并尝试保存到依赖列表时,如果遇到报错,可能的原因和解决办法有:

      1. 网络问题:由于 cnpm 是基于淘宝 npm 镜像,国内访问可能会更快,但仍有可能出现网络波动导致安装失败。可以尝试更换为原生 npm 或其他国内镜像源,如清华源(npm),命令如下:

      bash npm install --registry=https://registry.npm.taobao.org hexo-deployer-git --save

      bash npm install --registry=https://mirrors.tuna.tsinghua.edu.cn/npm/ hexo-deployer-git --save

      1. 权限问题:确保您有足够的权限在当前目录下写入文件。如果是 Linux 或 macOS 系统,可以尝试用 sudo 运行命令:

      bash sudo cnpm install hexo-deployer-git --save

      1. 插件版本或兼容性问题:确认您的 Hexo 版本与 hexo-deployer-git 插件的版本是否兼容。可以在 Hexo 博客根目录的 package.json 文件中查看 Hexo 版本,并选择对应版本的 hexo-deployer-git 进行安装,例如:

      bash cnpm install hexo-deployer-git@latest --save

      或指定特定版本:

      bash cnpm install hexo-deployer-git@<version> --save

      1. 清理缓存并重试:清除 npm 或 cnpm 缓存后重新安装:

      bash cnpm cache clean --force cnpm install hexo-deployer-git --save

      1. 检查 Node.js 和 npm 版本:确保您使用的 Node.js 和 npm 工具是最新稳定版或者至少满足 hexo-deployer-git 的要求。

      如果以上方法都无法解决问题,请详细查看报错信息,以便针对性地找到解决方案。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部