I tried to create a project through npx
, but an error occurred.
$ npx react-native init springtesting
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
Please try again manually: "cd ./springtesting/ios && pod install".
So I executed a sentence inside the ios folder in the project.
$ pod install
[!] Invalid `Podfile` file: [!] /usr/local/bin/node -e console.log(require('@react-native-community/cli').bin);
internal/modules/cjs/loader.js:983
throw err;
^
Error: Cannot find module '@react-native-community/cli'
Require stack:
- /Users/myname/springtesting/ios/[eval]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1040:19)
at require (internal/modules/cjs/helpers.js:72:18)
at [eval]:1:13
at Script.runInThisContext (vm.js:120:20)
at Object.runInThisContext (vm.js:311:38)
at Object.<anonymous> ([eval]-wrapper:10:26)
at Module._compile (internal/modules/cjs/loader.js:1151:30)
at evalScript (internal/process/execution.js:94:25) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/User/myname/springtesting/ios/[eval]' ]
}
.
# from /Users/taehong/springtesting/ios/Podfile:42
# -------------------------------------------
#
> use_native_modules!
# end
# -------------------------------------------
Pod version
$ pod --version
1.8.4
What's the problem?
And then i deleted the phrase 'use_native_modules' and it became normal.