node.js - 使用 Node@10.9.0 导入 o​​racledb@3.0.0 时 mkdir 权限错误

标签 node.js npm node-oracledb

当我尝试使用 Node 10.9.0 导入 oracledb@3.0.0 时,出现以下错误,

oracledb Beginning installation
oracledb Verifying installation
oracledb Continuing installation
oracledb ERR! NJS-054: Binary build/Release/oracledb.node was not installed.
oracledb ERR! Failed to install binary package oracledb-v3.0.0-node-abi64-linux-x64.gz
oracledb ERR! EACCES: permission denied, mkdir 'build'
oracledb ERR! For help see https://oracle.github.io/node-oracledb/INSTALL.html#troubleshooting

由于上面的代码似乎是权限问题,我也尝试了 sudo npm i mypck@3.2.0 但随后出现以下错误

sudo: npm: command not found

问题:

如何授予创建目录或使用 sudo 权限执行命令 npm 的权限,任何帮助将不胜感激。

最佳答案

在 npm install 中使用 --unsafe-perm=true--allow-root 标志。

npm install -g oracledb@3.0.0 --unsafe-perm=true --allow-root

您可以在这里阅读更多内容:https://docs.npmjs.com/getting-started/fixing-npm-permissions

关于node.js - 使用 Node@10.9.0 导入 o​​racledb@3.0.0 时 mkdir 权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52962510/

相关文章:

javascript - 在nodejs中保存从url保存的图像时出现问题

javascript - 读取和使用保存在 DB (LOB) 中的 XML

javascript - NJS-024 : memory allocation failed in OracleDB - Nodejs

node.js - 如何通过 postinstall npm 脚本自动将文件从包复制到本地目录?

node.js - 如何使用 API key 保护 REST API

node.js - 在 ubuntu 上安装 npm 模块出现错误

node.js - npm 不支持 Node.js v10.0.0 但安装了旧版本

Node.js - Oracle 驱动程序 - 检索 Clob 字段

javascript - 将 facebook token 从客户端发送到服务器的正确方法

node.js - 使用 GET 请求调用聚合函数