首页 > 解决方案 > 无法安装领域-cli (Mac)

问题描述

我正在关注这个领域教程,但在安装领域-cli 时遇到了问题。我正在运行 sudo npm install -g mongodb-realm-cli,这给了我以下错误:

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
/usr/local/bin/realm-cli -> /usr/local/lib/node_modules/mongodb-realm-cli/wrapper.js

> mongodb-realm-cli@2.1.0 install /usr/local/lib/node_modules/mongodb-realm-cli
> node install.js

downloading "realm-cli" from "https://s3.amazonaws.com/realm-clis/realm_cli_rhel70_97239c6794575bad1486a178501366cea7e7d399_21_08_16_19_49_31/macos-amd64/realm-cli"
failed to download Realm CLI: Error: EACCES: permission denied, open '/usr/local/lib/node_modules/mongodb-realm-cli/realm-cli'
at Object.openSync (fs.js:498:3)
at /usr/local/lib/node_modules/mongodb-realm-cli/install.js:62:24
 at new Promise (<anonymous>)
at requstBinary (/usr/local/lib/node_modules/mongodb-realm-cli/install.js:56:10)
at Object.<anonymous> (/usr/local/lib/node_modules/mongodb-realm-cli/install.js:101:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: '/usr/local/lib/node_modules/mongodb-realm-cli/realm-cli'

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mongodb-realm-cli@2.1.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mongodb-realm-cli@2.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

这是我到目前为止所拥有的:node -v: 14.17.6, npm -v: 6.14.15

PS:它在 Windows 10 上运行良好。

提前致谢!

标签: mongodbnpmrealm

解决方案


推荐阅读