Perhaps the problem is in cocoapods or that there is something wrong in my json .
However, it does not show errors in the code.
When i try install any library by using yarn i see this :
purrweb@192 awesomeProject % yarn add react-native-image-picker yarn add v1.22.21 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/5] Validating package.json... [2/5] Resolving packages... ⠂ pods:install@cd ios && pod install && cd ..(node:6200) [DEP0040] DeprecationWarning: The
punycodemodule is deprecated. Please use a userland alternative instead. (Usenode --trace-deprecation ...to show where the warning was created) error Error: https://registry.yarnpkg.com/pods:install: Not found at params.callback [as _callback] (/usr/local/lib/node_modules/yarn/lib/cli.js:66148:18) at self.callback (/usr/local/lib/node_modules/yarn/lib/cli.js:140874:22) at Request.emit (node:events:519:28) at Request. (/usr/local/lib/node_modules/yarn/lib/cli.js:141846:10) at Request.emit (node:events:519:28) at IncomingMessage. (/usr/local/lib/node_modules/yarn/lib/cli.js:141768:12) at Object.onceWrapper (node:events:633:28) at IncomingMessage.emit (node:events:531:35) at endReadableNT (node:internal/streams/readable:1696:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
My package.json:
{
"name": "awesomeProject",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"react": "18.2.0",
"react-native": "0.73.5"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.73.21",
"@react-native/eslint-config": "0.73.2",
"@react-native/metro-config": "0.73.5",
"@react-native/typescript-config": "0.73.1",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"metro": "^0.80.6",
"metro-core": "^0.80.6",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4",
"pods:install": "cd ios && pod install && cd .."
},
"engines": {
"node": ">=18"
}
}
I try use npm , but there is another error:
purrweb@192 awesomeProject % npm install react-hook-formnpm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "pods:install" of package "pods:install@cd ios && pod install && cd ..": name can only contain URL-friendly characters.
npm ERR! A complete log of this run can be found in: /Users/purrweb/.npm/_logs/2024-03-07T09_32_27_068Z-debug-0.log
I noticed a similar warning today . The issue went off after I deleted package.json file.I had used yarn and npm interchangeable until now in my side project. 'npm install' creates package-lock.json and 'yarn install' generates yarn.lock . Normally you stick to either one of the package managers in your project .