我的系统是mac,我在输入下面的命令:

sudo npm install -g aglio

出现了下面的问题:

npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated constantinople@3.0.2: Please update to at least constantinople 3.1.1
npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformer
npm WARN deprecated hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated cryptiles@2.0.5: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/aglio -> /usr/local/lib/node_modules/aglio/bin/aglio.js> fsevents@1.2.7 install /usr/local/lib/node_modules/aglio/node_modules/fsevents
> node installnode-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.7 and node@8.12.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/eric/.node-gyp/8.12.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/aglio/node_modules/fsevents/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/fsevents
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/aglio/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:915:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 18.0.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/aglio/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/fsevents
node-pre-gyp ERR! node -v v8.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)> protagonist@1.6.8 install /usr/local/lib/node_modules/aglio/node_modules/protagonist
> node-gyp rebuildgyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/eric/.node-gyp/8.12.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/aglio/node_modules/protagonist/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/protagonist/.node-gyp'
gyp ERR! System Darwin 18.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/protagonist
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok> aglio-theme-olio@1.6.3 postinstall /usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio
> node scripts/setup-cache.jsfs.js:885return binding.mkdir(pathModule._makeLong(path),^Error: EACCES: permission denied, mkdir './cache'at Object.fs.mkdirSync (fs.js:885:18)at Object.<anonymous> (/usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio/scripts/setup-cache.js:14:6)at Module._compile (module.js:653:30)at Object.Module._extensions..js (module.js:664:10)at Module.load (module.js:566:32)at tryModuleLoad (module.js:506:12)at Function.Module._load (module.js:498:3)at Function.Module.runMain (module.js:694:10)at startup (bootstrap_node.js:204:16)at bootstrap_node.js:625:3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/aglio/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: protagonist@1.6.8 (node_modules/aglio/node_modules/protagonist):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: protagonist@1.6.8 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aglio-theme-olio@1.6.3 postinstall: `node scripts/setup-cache.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aglio-theme-olio@1.6.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/eric/.npm/_logs/2019-02-14T00_47_21_128Z-debug.log

查资料发现,正确的做法应该是:

 sudo npm install -g aglio --unsafe-perm=true --allow-root

然后就可以正常了。

参考文献

[1].Error: EACCES: permission denied, mkdir '/root/.nvm/versions/node/....... https://www.jianshu.com/p/6c67a456654b

mac Error: EACCES: permission denied, mkdir './cache'相关推荐

  1. mac上安装webpack报错解决方法Hit error EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/webpack

    mac上安装webpack报错解决方法Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/webpack 参 ...

  2. Error: EACCES: permission denied, mkdir

    近期在macos开发环境下使用npm,经常会出现无法mkdir,permission denied的问题,在windows下并没有遇到这种情况. 经查询需要在指令前使用sudo指令,例如:npm in ...

  3. 在root目录下npm install报错Error: EACCES: permission denied, mkdir ‘/root/ttt/web/node_modul

    报错如下:Error: EACCES: permission denied, mkdir '/root/pgadmin4-REL-4_23/web/node_modules/imagemin-gifs ...

  4. npm报错stack Error: EACCES: permission denied, mkdir

    目录 一.问题描述 二.解决方法 一.问题描述 执行 npm 报错:stack Error: EACCES: permission denied, mkdir npm install webpack ...

  5. Unable to save binary node-sass/vendor/linux-x64-72 : Error: EACCES: permission denied, mkdir

    前言 略 错误 [root@tencent-test-01 src]# npm install npm WARN deprecated tar@2.2.2: This version of tar i ...

  6. NPM 安装报 Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/xxxxxx‘

    NPM权限问题 最近作者在安装RN环境的时候遇到一个npm权限不足问题,具体报 Error: EACCES: permission denied, mkdir '/usr/local/lib/node ...

  7. 解决 npm install Error: EACCES: permission denied, mkdir node_modules/gifsicle/

    1. 原因CentOS jenkins自动构建服务 使用root账号执行npn install 指令,报错如下 > gifsicle@4.0.1 postinstall /***//node_m ...

  8. gyp ERR! stack Error: EACCES: permission denied, mkdir

    1.原因 npm 出于安全考虑不支持以 root 用户运行,即使你用 root 用户身份运行了,npm 会自动转成一个叫 nobody 的用户来运行,而这个用户几乎没有任何权限.这样的话如果你脚本里有 ...

  9. npm install 报错 EACCES: permission denied, mkdir XXXX

    一.npm版本 [root@iz8vb2aig38pyedluqu4asz]# npm -version 6.14.4 二.报错现象 Copying to target path /data/jenk ...

  10. Mac cnpm装包时提示Error: EACCES: permission denied解决办法

    Cnpm装包时提示Error: EACCES: permission denied解决办法 2018年03月04日 09:31:51 miniminixu 阅读数:1598 版权声明:本文为博主原创文 ...

最新文章

  1. 德国最有影响力的数学家(上)
  2. python数据库查询不出结果_记一次pymysql查询不到表中最新插入的数据的问题
  3. hive practice 1
  4. Sass学习笔记(一)
  5. 【数据结构与算法】之深入解析“分割数组的最大值”的求解思路与算法示例
  6. STM32U5来了,100份好礼免费送!
  7. POJ 3690 找星座(2D匹配)(未解答)
  8. Android相机开发实战
  9. 计算机领域顶级会议列表
  10. 文本超过指定行数折叠
  11. matlab 球坐标系作图,使用Matlab的mapping tool在球坐标系下画图
  12. 在Tiled Map中使用碰撞检测
  13. 【Windows系统相关问题记录一】在原有Win10 EFI分区还在的前提下,使用DiskGenius误删EFI文件夹
  14. wps字体缺失,问题
  15. 如何做一个好的项目经理
  16. 【枚举法(穷举法)】
  17. 数据库常用的几种引擎,区别和比较
  18. Tensorrt 7.2.3 转换yolov5 v3.0 pytorch1.8.1 onnx1.6.0
  19. linux 替换文件中的字符串——sed
  20. CTF隐写题目-九连环

热门文章

  1. NSACE|企业网络安全问题,千万别不在乎
  2. 研大考研:2015考研政治认识论知识点
  3. 小学数学题生成器java_JAVA小学四则运算生成器(聂适涵,邱品)
  4. mysql 5.7 临时表_MySQL 5.7内部临时表使用
  5. 解决: 0x803f7001 在运行Microsoft Windows 非核心版本的计算机上,运行“ slui.exe 0x2a 0x803f7001 “以显示错误文本,激活win10步骤流程。
  6. html5 app 原理,浅析开发html5 app的三大优势
  7. linux sed替换行,shell - 使用Sed替换包含字符串的整行
  8. 老板电器应收账款较年初增近七成 Q3净利增速环比拦腰斩半
  9. office表格怎么冻结前两行_「excel冻结前两行」excel2013怎么冻结前两行 - seo实验室...
  10. 从官网下win10太慢了怎么办?