npm install 报错,提示`gyp ERR! stack Error: EACCES: permission denied` 解决方法
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` 解决方法的更多相关文章
- gyp ERR! stack Error: EACCES: permission denied, mkdir问题解决方案
sudo npm i --unsafe-perm 原因还是权限问题 就是说 npm 出于安全考虑不支持以 root 用户运行,即使你用 root 用户身份运行了,npm 会自动转成一个叫 nobody ...
- 编译lua5.3.2报错提示libreadline.so存在未定义的引用解决方法
从官网上下载5.3.2的源码后,make linux进行编译,提示报错: gcc -std=gnu99 -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline ...
- npm install时报错“Unexpected end of JSON input while parsing near...”解决方法
执行:npm cache clean --force 即可解决此问题
- npm安装报错:Error: EACCES: permission denied
报错如下: sudo npm i webpack -g /Users/xesfe/.npm-global/bin/webpack -> /Users/xesfe/.npm-global/lib/ ...
- 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 ...
- WSL中使用npm install报错
报错内容类似下面的格式.具体解决方法请看这里:https://github.com/Microsoft/WSL/issues/14 着重关注 https://github.com/Microsoft/ ...
- npm install 报错:node-pre-gyp ERR! 问题解决
npm install报错问题解决 问题: E:\CodeSpace\GitlabTest\desktop>npm install > lifeccp-desktop@1.1.9 post ...
- 『奇葩问题集锦』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 ...
- 执行npm install报错:npm ERR! code EINTEGRITY
命令行执行npm install报错如下: D:\frontend\viewsdev>npm install npm ERR! code EINTEGRITY npm ERR! sha512-8 ...
随机推荐
- IIS 报错试图加载格式不正确的程序集解决办法
原因: 64位系统和32系统不匹配导致. 解决办法: 方法一.注册32位IIS(必须卸载64位IIS) 使用命令 X:WindowsMicrosoft.NETFramework64v4.0.30319 ...
- SOA简介
1.你可以把SOA理解为一种概念,总的来说就是面向服务的设计. 这个概念简单来理解就是把之前所谓的模块划分做成服务. 比如之前的日志模块,需要引用你的dll,调用你的写日志方法来写日志.这样当有多个系 ...
- Invalid Django TIME_ZONE
在linux操作系统运行,设置的时区在系统文件/usr/share/zoneinfo/中找不到会出现以下错误 raceback (most recent call last): File , in & ...
- python爬虫播放mp3
我不明白这里出了什么问题.每次我试图在pyglet播放声音,我得到以下错误:WAVEFormatException: AVbin is required to decode compressed me ...
- 转SQLSERVER 会不会自动加锁
[SQL]提升查询效率与避免LOCK发生nolock: 可能把没有提交事务的数据也显示出来,可能会产生脏读readpast: 会把被锁住的行不显示出来 所有Select加 With (NoLock)解 ...
- Python-数据库连表查询、子查询
连表查询 [实例]通过例子来熟悉连表查询的概念 # 第一步:建表 # 建立英雄职业分类表格 create table classification( id int, name varchar(20) ...
- PTA(Basic Level)1006.Sign In and Sign Out
At the beginning of every day, the first person who signs in the computer room will unlock the door, ...
- java中利用hanlp比较两个文本相似度的步骤
使用 HanLP - 汉语言处理包 来处理,他能处理很多事情,如分词.调用分词器.命名实体识别.人名识别.地名识别.词性识别.篇章理解.关键词提取.简繁拼音转换.拼音转换.根据输入智能推荐.自定义分词 ...
- 关闭mysql查询缓存query cache(用户测试性能)
先对query cache进行查询 mysql> show global variables like '%cache%'; 查看query_cache_size.query_cache_typ ...
- python-day29(正式学习)
目录 元类 什么是元类 为什么用元类 内置函数exec class创建类 type实现 自定义元类 _ _ call _ _ _ _ new _ _ 自定义元类控制的实例化 属性查找顺序 元类 警告! ...