当我尝试使用 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 导入 oracledb@3.0.0 时 mkdir 权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52962510/