Reputation: 21
in react native project, when yarn ios below error is happen how can i solve
error str.replace is not a function.
yangseon-uui-MacBookPro:LearnReactNative yangseon-u$ yarn ios yarn run v1.22.19 warning ../package.json: No license field $ react-native run-ios warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.6.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md error str.replace is not a function. TypeError: str.replace is not a function at inlineString (/Users/yangseon-u/LearnReactNative/node_modules/@react-native-community/cli-tools/build/errors.js:25:33) at new CLIError (/Users/yangseon-u/LearnReactNative/node_modules/@react-native-community/cli-tools/build/errors.js:13:11) at getProjectInfo (/Users/yangseon-u/LearnReactNative/node_modules/@react-native-community/cli-platform-ios/build/tools/getProjectInfo.js:29:11) at Object.runIOS [as func] (/Users/yangseon-u/LearnReactNative/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:82:58) at Command.handleAction (/Users/yangseon-u/LearnReactNative/node_modules/@react-native-community/cli/build/index.js:108:23) at Command.listener [as _actionHandler] (/Users/yangseon-u/LearnReactNative/node_modules/commander/lib/command.js:482:17) at /Users/yangseon-u/LearnReactNative/node_modules/commander/lib/command.js:1283:65 at Command._chainOrCall (/Users/yangseon-u/LearnReactNative/node_modules/commander/lib/command.js:1177:12) at Command._parseCommand (/Users/yangseon-u/LearnReactNative/node_modules/commander/lib/command.js:1283:27) at /Users/yangseon-u/LearnReactNative/node_modules/commander/lib/command.js:1081:27 info Run CLI with --verbose flag for more details.
remove node_modules and install yarn and upgrade but still it is happen...
Upvotes: 1
Views: 2510
Reputation: 1
In my case, I faced this error after clone a repo and try to run on ios platform. After doing some research, I found out that it might because the neccessary permissions are missing. This can happen if the repo is pushed from Linux and you clone onto Windows.
To identify if this is the issue, you can check the file permission either via command line or check property tab (get info in MacOS) of a file under the repo to see if you have the execution permission.
If you don't have the permission, you can run this command:
sudo chmod -R 774 <*your repo name*>/
then run this command if you want to ignore the permission changes:
git config core.filename false
if the permission file change method does not work, you may want to change the owner too:
sudo chown -R <*your account username*> <*your repo name*>/
Hope this helps!
Upvotes: 0
Reputation: 1
look in your project .replace and check the input parameters, one should receive undefined
Upvotes: -1