700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > mac Error: EACCES: permission denied mkdir './cache'

mac Error: EACCES: permission denied mkdir './cache'

时间:2022-10-30 01:13:49

相关推荐

mac Error: EACCES: permission denied  mkdir './cache'

我的系统是mac,我在输入下面的命令:

sudo npm install -g aglio

出现了下面的问题:

npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)npm WARN deprecated jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jadenpm WARN deprecated constantinople@3.0.2: Please update to at least constantinople 3.1.1npm WARN deprecated transformers@2.1.0: Deprecated, use jstransformernpm WARN deprecated hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.npm WARN deprecated boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.npm WARN deprecated cryptiles@2.0.5: This version is no longer maintained. Please upgrade to the latest version.npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue/usr/local/bin/aglio -> /usr/local/lib/node_modules/aglio/bin/aglio.js> fsevents@1.2.7 install /usr/local/lib/node_modules/aglio/node_modules/fsevents> node installnode-pre-gyp WARN Using request for node-pre-gyp https downloadnode-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.7 and node@8.12.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib'gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/eric/.node-gyp/8.12.0"gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/aglio/node_modules/fsevents/.node-gyp"gyp WARN install got an error, rolling back installgyp WARN install got an error, rolling back installgyp ERR! configure errorgyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/fsevents/.node-gyp'gyp ERR! System Darwin 18.0.0gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64" "--napi_version=3" "--node_abi_napi=napi"gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/fseventsgyp ERR! node -v v8.12.0gyp ERR! node-gyp -v v3.8.0gyp ERR! not oknode-pre-gyp ERR! build errornode-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)node-pre-gyp ERR! stackat ChildProcess.<anonymous> (/usr/local/lib/node_modules/aglio/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)node-pre-gyp ERR! stackat emitTwo (events.js:126:13)node-pre-gyp ERR! stackat ChildProcess.emit (events.js:214:7)node-pre-gyp ERR! stackat maybeClose (internal/child_process.js:915:16)node-pre-gyp ERR! stackat Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)node-pre-gyp ERR! System Darwin 18.0.0node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/aglio/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"node-pre-gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/fseventsnode-pre-gyp ERR! node -v v8.12.0node-pre-gyp ERR! node-pre-gyp -v v0.10.3node-pre-gyp ERR! not okFailed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/aglio/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)> protagonist@1.6.8 install /usr/local/lib/node_modules/aglio/node_modules/protagonist> node-gyp rebuildgyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/eric/.node-gyp/8.12.0"gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/aglio/node_modules/protagonist/.node-gyp"gyp WARN install got an error, rolling back installgyp WARN install got an error, rolling back installgyp ERR! configure errorgyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/aglio/node_modules/protagonist/.node-gyp'gyp ERR! System Darwin 18.0.0gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"gyp ERR! cwd /usr/local/lib/node_modules/aglio/node_modules/protagonistgyp ERR! node -v v8.12.0gyp ERR! node-gyp -v v3.8.0gyp ERR! not ok> aglio-theme-olio@1.6.3 postinstall /usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio> node scripts/setup-cache.jsfs.js:885return binding.mkdir(pathModule._makeLong(path),^Error: EACCES: permission denied, mkdir './cache'at Object.fs.mkdirSync (fs.js:885:18)at Object.<anonymous> (/usr/local/lib/node_modules/aglio/node_modules/aglio-theme-olio/scripts/setup-cache.js:14:6)at Module._compile (module.js:653:30)at Object.Module._extensions..js (module.js:664:10)at Module.load (module.js:566:32)at tryModuleLoad (module.js:506:12)at Function.Module._load (module.js:498:3)at Function.Module.runMain (module.js:694:10)at startup (bootstrap_node.js:204:16)at bootstrap_node.js:625:3npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/aglio/node_modules/fsevents):npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 install: `node install`npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1npm WARN optional SKIPPING OPTIONAL DEPENDENCY: protagonist@1.6.8 (node_modules/aglio/node_modules/protagonist):npm WARN optional SKIPPING OPTIONAL DEPENDENCY: protagonist@1.6.8 install: `node-gyp rebuild`npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! aglio-theme-olio@1.6.3 postinstall: `node scripts/setup-cache.js`npm ERR! Exit status 1npm ERR!npm ERR! Failed at the aglio-theme-olio@1.6.3 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!/Users/eric/.npm/_logs/-02-14T00_47_21_128Z-debug.log

查资料发现,正确的做法应该是:

sudo npm install -g aglio --unsafe-perm=true --allow-root

然后就可以正常了。

参考文献

[1].Error: EACCES: permission denied, mkdir '/root/.nvm/versions/node/......./p/6c67a456654b

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。