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. mysql sql常用语句

    1.说明:创建数据库 CREATE DATABASE database-name 2.说明:删除数据库 drop database dbname 3.说明:备份sql server --- 创建 备份 ...

  2. 如何在gradle项目中添加额外非开源jar包并提交代码

    前提:项目开发中,遇到一个地方需要用到公司自定义的jar包,然后要放到代码里又不方便提交到私服 具体实施: 首先在项目中增加一个 libs目录,然后把这种非开源又不在私服上的jar包扔进去, 然后打开 ...

  3. The inherit, initial, and unset values

    The  inherit, initial, and unset keywords are special values you can give to any CSS property. Tests ...

  4. kubernetes学习:CKA考试认证

    考点 CKA认证针对考核成为当业界的Kubernetes管理员所需的技能. CKA认证考试包括这些一般领域及其在考试中的权重: 应用程序生命周期管理 -  8% 安装.配置和验证 -  12% 核心概 ...

  5. Linux Openssh源码升级

    telnet服务 yum install -y telnet-server xinetd systemctl start xinetd systemctl start telnet.socket #监 ...

  6. IDEA "Library source does not match the bytecode for class"问题

    问题描述 Jar包更新后,报错信息:"Library source does not match the bytecode for class" 经检查,发现Jar内容还是旧版本的 ...

  7. vue中封装swipe组件

    <template> <!-- TODO swipe --> <div id="hy-swiper"> <div class=" ...

  8. 大觅网02Day

    docker环境搭建:(注:请先完成上一次的环境搭建) A.部署环境(导入上次系统的时候修改虚拟机的内存) 1.安装系统自带版本Docker:apt-get install docker.io 2.查 ...

  9. 【Python开发】查看数据类型

    import types aaa = 0 print type(aaa) if type(aaa) is types.IntType: print "the type of aaa is i ...

  10. 【VS开发】C++线程安全

    我们是多么渴望各种C++类都是多线程安全的,然而一旦涉及到对象间的交互,这样的渴望可能就只能是奢望了.下面,我们以设计一个双向链结点为例,看看要使其多线程安全将会带来一些什么问题. class Dou ...