【问题标题】:npm-deployer-git cannot be installednpm-deployer-git 无法安装
【发布时间】:2015-12-02 08:22:48
【问题描述】:

我想将我的 hexo 站点推送到我的 github 上。当我尝试这个 hexo d 时,它说 ERROR Deployer not found: git。所以我尝试安装它,但得到了以下内容。

clatisus@clatisus-GL552JX:~$ npm install hexo-deployer-git --save
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.5
npm ERR! Linux 3.19.0-33-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "hexo-deployer-git" "--save"
npm ERR! node v0.11.2
npm ERR! npm  v3.5.1
npm ERR! path /home/clatisus/node_modules/.staging
npm ERR! code EACCES
npm ERR! errno 3

npm ERR! Error: EACCES, mkdir '/home/clatisus/node_modules/.staging'
npm ERR!  { [Error: EACCES, mkdir '/home/clatisus/node_modules/.staging']
npm ERR!   stack: 'Error: EACCES, mkdir \'/home/clatisus/node_modules/.staging\'',
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/home/clatisus/node_modules/.staging' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/clatisus/npm-debug.log

【问题讨论】:

    标签: git ubuntu github npm hexo


    【解决方案1】:

    它不起作用,因为 npm 没有在此文件夹中写入的权限。要快速解决此问题,请使用 sudo 运行此命令。

    例如

    sudo npm install hexo-deployer-git --save
    

    另外,running npm with sudo is not recommended,阅读官方 npm 文档以修复 npm 权限:fixing npm permissions

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-07
      • 1970-01-01
      • 1970-01-01
      • 2021-10-13
      • 1970-01-01
      • 2018-12-07
      • 2017-12-12
      相关资源
      最近更新 更多