m install 报错,提示gyp ERR! stack Error: EACCES: permission denied

猜测可能是因为没有权限读写,ls -la看下文件权限设置情况

[root@root vendors]# ls -la
drwxr-xr-x root root Jun : node_modules
-rwxr-xr-x root root Jun : package.json
-rw-r--r-- root root Jun : package-lock.json

只有root用户组有读写权限,其他只读,将node_modules文件夹修改权限,再执行看看

[root@root vendors]# npm i --production

> jsonpath@1.0. postinstall /www/server/yapi/vendors/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js sh: generated/aesprim-browser.js: Permission denied
npm WARN mongoose-auto-increment@5.0. requires a peer of mongoose@^4.1. but none is installed. You must install peer dependencies yourself. npm ERR! code ELIFECYCLE
npm ERR! errno
npm ERR! jsonpath@1.0. postinstall: `node lib/aesprim.js > generated/aesprim-browser.js`
npm ERR! Exit status
npm ERR!
npm ERR! Failed at the jsonpath@1.0. 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! /root/.npm/_logs/--05T15_10_22_303Z-debug.log

经过面向搜索引擎开发,有提到用sudo,但是发现还是不行,实际原因是由于用的是root账户权限执行npm,而npm默认是不适用root权限创建内容,因此会出现权限问题而导致失败,加上参数--unsafe-perm=true --allow-root即可解决问题。

npm install --production --unsafe-perm=true --allow-root

npm install 报错,提示`gyp ERR! stack Error: EACCES: permission denied` 解决方法的更多相关文章

  1. gyp ERR! stack Error: EACCES: permission denied, mkdir问题解决方案

    sudo npm i --unsafe-perm 原因还是权限问题 就是说 npm 出于安全考虑不支持以 root 用户运行,即使你用 root 用户身份运行了,npm 会自动转成一个叫 nobody ...

  2. 编译lua5.3.2报错提示libreadline.so存在未定义的引用解决方法

    从官网上下载5.3.2的源码后,make linux进行编译,提示报错: gcc -std=gnu99 -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline ...

  3. npm install时报错“Unexpected end of JSON input while parsing near...”解决方法

    执行:npm cache clean --force 即可解决此问题

  4. npm安装报错:Error: EACCES: permission denied

    报错如下: sudo npm i webpack -g /Users/xesfe/.npm-global/bin/webpack -> /Users/xesfe/.npm-global/lib/ ...

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

    node-pre-gyp WARN Using needle for node-pre-gyp https download node-pre-gyp WARN Pre-built binaries ...

  6. WSL中使用npm install报错

    报错内容类似下面的格式.具体解决方法请看这里:https://github.com/Microsoft/WSL/issues/14 着重关注 https://github.com/Microsoft/ ...

  7. npm install 报错:node-pre-gyp ERR! 问题解决

    npm install报错问题解决 问题: E:\CodeSpace\GitlabTest\desktop>npm install > lifeccp-desktop@1.1.9 post ...

  8. 『奇葩问题集锦』npm install 报错 node-pre-gyp ERR! node-pre-gyp -v v0.6.25

    gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you ...

  9. 执行npm install报错:npm ERR! code EINTEGRITY

    命令行执行npm install报错如下: D:\frontend\viewsdev>npm install npm ERR! code EINTEGRITY npm ERR! sha512-8 ...

随机推荐

  1. brew update 很慢

    brew使用国内镜像源 这里用中科大的,另外还有清华的可用 # 步骤一 cd $(brew --repo) git remote set-url origin https://mirrors.tuna ...

  2. C++ 学习笔记整理

    目录 STL 容器 set的用法简介 unordered_set 变量类型转换 stringstream 类型转换 数据结构 哈希表 日常小技巧 C++输入输出流加速器,关闭同步流,ios::sync ...

  3. docker解决没有vim问题

    正确(1)下载镜像,docker pull nginx(2)启动容器,docker run -d -p 8083:80 nginx[root@ceshi ~]# docker exec -it 8ca ...

  4. js控件实现修改预览的功能

    http://nytimes.github.io/ice/demo/ https://johnresig.com/projects/javascript-diff-algorithm/

  5. JavaScript高程第三版笔记-面向对象编程

    之前有篇博客曾提到过一点js的面向对象编程:js面向对象编程. 这里就结合js高程详细剖析一下javascript的面向对象编程. 前序: 1⃣️Object.defineProperty() var ...

  6. zabbix支持的主要监控方式

    一.zabbix支持的主要监控方式: zabbix主要Agent,Trapper,SNMP,JMX,IPMI这几种监控方式,本文章主要通过监控理论和实际操作测试等方式来简单介绍这几种方式的监控原理和优 ...

  7. Typora快捷键记录

    目前使用的是Typora这款Markdown软件,记录一下快捷键用法: 1.无序列表,黑色实心圆点或白色空心圆点 首先去除缩进,使用“Ctrl”+"["键或者“Shift”+&qu ...

  8. 【Linux开发】linux设备驱动归纳总结(二):模块的相关基础概念

    linux设备驱动归纳总结(二):模块的相关基础概念 系统平台:Ubuntu 10.04 开发平台:S3C2440开发板 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...

  9. DiskSim

    1.使用笔记 http://feifei432.blog.163.com/blog/static/140253361201022211949152/ http://feifei432.blog.163 ...

  10. 菜鸟系列Fabric——Fabric 网络架构介绍(4)

    Fabric 网络架构介绍 1. 网络架构介绍 如图所示,fabric网络架构主要包含客户端节点.CA节点.Peer节点.Orderer节点这几个部分.并且fabric架构是安装组织来进行划分当,每个 ...