当我在xcode中运行react native项目时,出现以下错误。 Metro Bunlder由于某种原因而失败。
这是在启动的终端窗口中显示的错误。
error ENOTDIR: not a directory, mkdir '/var/folders/h6/952khgzj1zncqsd5rdsdk5240000gn/T/metro-cache/00'. Run CLI with --verbose flag for more details.
Error: ENOTDIR: not a directory, mkdir '/var/folders/h6/952khgzj1zncqsd5rdsdk5240000gn/T/metro-cache/00'
at Object.mkdirSync (fs.js:757:3)
at Function.sync (/Users/aaaa/Documents/newton/connectedblue/node_modules/mkdirp/index.js:71:13)
at FileStore._createDirs (/Users/aaaa/Documents/newton/connectedblue/node_modules/metro-cache/src/stores/FileStore.js:94:14)
at new FileStore (/Users/aaaa/Documents/newton/connectedblue/node_modules/metro-cache/src/stores/FileStore.js:27:10)
at getDefaultValues (/Users/aaaa/Documents/newton/connectedblue/node_modules/metro-config/src/defaults/index.js:164:5)
at /Users/aaaa/Documents/newton/connectedblue/node_modules/metro-config/src/defaults/index.js:191:12
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/aaaa/Documents/newton/connectedblue/node_modules/metro-config/src/defaults/index.js:14:24)
at _next (/Users/aaaa/Documents/newton/connectedblue/node_modules/metro-config/src/defaults/index.js:34:9)
at /Users/aaaa/Documents/newton/connectedblue/node_modules/metro-config/src/defaults/index.js:39:7`
该项目以前可以正常运行,但不会失败。
答案 0 :(得分:0)
实际上,按照错误消息中的说明创建目录后,它开始工作。