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. SQL Server批量备份数据库

    --批量备份数据库201911 --开启文件夹权限 GO SP_CONFIGURE RECONFIGURE GO SP_CONFIGURE RECONFIGURE GO DECLARE ), ), ) ...

  2. MongoDB数据库数据清理

    清理MongoDB集群数据: 1.登录MongoDB集群(mongos): # mongo -u username -p password --authenticationDatabase admin ...

  3. Head First HTML 与 CSS 学习笔记

    总的来说,这本书作为入门HTML和CSS还是不错的,讲解生动有趣,这也是Head First系列书籍的特点.缺点就是讲解的不够全面~ 第三章 一般来讲,如果要引用一段或者多段文字, 就要使用<b ...

  4. [LeetCode] 697. Degree of an Array 数组的度

    Given a non-empty array of non-negative integers nums, the degree of this array is defined as the ma ...

  5. 【ABAP系列】SAP 使用特殊的技术更新数据库(ABAP)

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP 使用特殊的技术更新数据库 ...

  6. js动态修改浏览器title

    script标签依据浏览框的失焦获焦进行函数操作(操作简单放到HTML文件下的head标签下就可以) <script> window.onfocus = function () { doc ...

  7. PJzhang:shell基础入门的2个疗程-two

    猫宁!!! 第6节:重定向 标准输入,标准输出,错误输出 输入重定向符号'<' 输出重定向符号'>'(清空之后再输入),'>>'(当前内容不变,在最后一行追加),'2>' ...

  8. 字符串转 Boolean 的正确方式

    String s1 = "false"; String s2 = "true"; String s3 = "fAlSe"; String s ...

  9. PostgreSQL查看等待锁的SQL和进程

    查看等待锁的查询和进程: The following query may be helpful to see what processes are blocking SQL statements (t ...

  10. SpreadJS 纯前端表格控件 V12.2 发布更新

    用不到100行代码,在前端实现Excel的全部功能 千万前端开发者翘首企盼,SpreadJS V12.2 终发布更新:六大功能特性,带来更多便利,用不到100行代码,在前端实现Excel的全部功能! ...