MAC OS 执行mkdir提示 Operation not supported 的解决办法

本文介绍了解决Mac电脑在/home目录下新建目录时遇到的权限问题。通过修改auto_master配置文件并重启服务来实现/home目录的正常使用。

问题:

Mac 电脑在 /home目录下新建目录报错:

/home % mkdir tmp
mkdir: tmp: Operation not supported
解决办法:

1、编辑/etc/auto_master文件,将包含auto_home>      -nobrowse,hidefromfinder的行注视掉

/home % sudo vim /etc/auto_master


# Automounter master map
#
+auto_master>   >       # Use directory service
#/net>  >       >       -hosts> >       -nobrowse,hidefromfinder,nosuid
#/home> >       >       auto_home>      -nobrowse,hidefromfinder
/Network/Servers>       -fstab
/->     >       >       -static


2、保存后,执行 sudo automount

/home % sudo automount


3、最后再重启电脑

PS D:\系统代码\qianduan> npm install --package-lock --package-lock-version=1 npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@3. I'll try to do my best with it! (node:7240) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead. (Use `node --trace-deprecation ...` to show where the warning was created) npm WARN deprecated eslint@7.32.0: This version is no longer supported. Please see https://eslint.org/version-support for other options. npm WARN deprecated webpack-chain@6.5.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated @humanwhocodes/config-array@0.5.0: Use @eslint/config-array instead npm WARN deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. npm WARN deprecated @humanwhocodes/object-schema@1.2.1: Use @eslint/object-schema instead npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are 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. npm WARN deprecated @types/minimatch@6.0.0: This is a stub types definition. minimatch provides its own type definitions, so you do not need this installed. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN acorn-import-phases@1.0.4 requires a peer of acorn@^8.14.0 but none is installed. You must install peer dependencies yourself. npm WARN @vue/eslint-config-typescript@9.1.0 requires a peer of eslint-plugin-vue@^8.0.1 but none is installed. You must install peer dependencies yourself. npm WARN The package eslint-plugin-vue is included as both a dev and production dependency. npm WARN The package less is included as both a dev and production dependency. npm WARN The package less-loader is included as both a dev and production dependency. npm ERR! code EPERM npm ERR! syscall mkdir npm ERR! path D:\系统代码\qianduan\node_modules npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, mkdir 'D:\系统代码\qianduan\node_modules' npm ERR! [OperationalError: EPERM: operation not permitted, mkdir 'D:\系统代码\qianduan\node_modules'] { npm ERR! cause: [Error: EPERM: operation not permitted, mkdir 'D:\系统代码\qianduan\node_modules'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'D:\\系统代码\\qianduan\\node_modules' npm ERR! }, npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'D:\\系统代码\\qianduan\\node_modules', npm ERR! parent: '@babel/highlight' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\asus\AppData\Roaming\npm-cache\_logs\2025-09-24T09_43_01_068Z-debug.log PS D:\系统代码\qianduan>
最新发布
09-25
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

徒步@天涯

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值