我有一个带有 RN 64.0 的新 React Native 项目,当我运行 npx pod install
时,它无法返回以下内容:
npx: installed 1 in 27.036s
Scanning for pods...
1.10.1
> pod install
Auto-linking React Native modules for target `MyMALnew`: RNCAsyncStorage, RNCMaskedView, RNGestureHandler, RNReanimated, RNScreens, and react-native-safe-area-context
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.64.0)
Installing FBReactNativeSpec (0.64.0)
[!] /bin/bash -c
set -e
mkdir -p /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec && touch /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h /Volumes/Macintosh HD - Data/WORK/MyMALnew/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm
mkdir: /Volumes/Macintosh: Permission denied
ps:这是我第一次在 RN 中使用 npx 前缀,不确定这是否是这里的问题:)
感谢您的帮助..
最佳答案
这是因为您的卷名称“Macintosh HD”由两个以空格分隔的单词组成。
此生成的路径 -> mkdir -p/Volumes/Macintosh HD 应替换为 mkdir -p "/Volumes/Macintosh HD" (添加引号)我认为是 RN 团队。
我遇到了同样的问题,将我的卷重命名为单个单词并重新安装 node_modules 解决了该问题。
关于ios - pod install mkdir 权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67160700/