0
votes

I was trying to create a project for react-native but I am getting this error.

D:\Projects\PoC\ReactNative>react-native init TravelApp
This will walk you through creating a new React Native project in D:\Projects\PoC\ReactNative\TravelApp
Using yarn v1.22.4
Installing react-native...
yarn add v1.22.4
info No lockfile found.
[1/4] Resolving packages...
warning react-native > fbjs-scripts > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > metro-babel-register > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > fbjs > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > create-react-class > fbjs > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
[2/4] Fetching packages...
error https://registry.yarnpkg.com/@react-native-community/cli/-/cli-4.10.1.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "EPERM: operation not permitted, open 'C:\\Users\\sushant.patekar\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@react-native-community-cli-4.10.1-3c1e74f55c004936368d3576d4c1da7d02b89904-integrity\\node_modules\\@react-native-community\\cli\\build\\commands\\init\\printRunInstructions.js'"
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
info There appears to be trouble with your network connection. Retrying...
Error: Command failed: yarn add react-native --exact
    at checkExecSyncError (child_process.js:611:11)
    at execSync (child_process.js:647:15)
    at run (C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js:294:5)
    at createProject (C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
    at init (C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
    at Object.<anonymous> (C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 4456,
  stdout: null,
  stderr: null
}
Command `yarn add react-native --exact` failed.

D:\Projects\PoC\ReactNative>yarn add react-native --exact
yarn add v1.22.4
info No lockfile found.
[1/4] Resolving packages...
warning react-native > fbjs > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > create-react-class > fbjs > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > fbjs-scripts > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > metro-babel-register > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
[2/4] Fetching packages...
error https://registry.yarnpkg.com/@react-native-community/cli/-/cli-4.10.1.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "EPERM: operation not permitted, open 'C:\\Users\\sushant.patekar\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@react-native-community-cli-4.10.1-3c1e74f55c004936368d3576d4c1da7d02b89904-integrity\\node_modules\\@react-native-community\\cli\\build\\commands\\init\\printRunInstructions.js'"
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

D:\Projects\PoC\ReactNative>npm install -g react-native-cli
C:\Users\sushant.patekar\AppData\Roaming\npm\react-native -> C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js
+ [email protected]
updated 1 package in 6.889s

D:\Projects\PoC\ReactNative>react-native init TravelApp_
This will walk you through creating a new React Native project in D:\Projects\PoC\ReactNative\TravelApp_
Using yarn v1.22.4
Installing react-native...
yarn add v1.22.4
info No lockfile found.
[1/4] Resolving packages...
warning react-native > fbjs-scripts > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > fbjs > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > create-react-class > fbjs > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > metro-babel-register > [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning react-native > @react-native-community/cli > metro-core > jest-haste-map > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
error https://registry.yarnpkg.com/@react-native-community/cli/-/cli-4.10.1.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "EPERM: operation not permitted, open 'C:\\Users\\sushant.patekar\\AppData\\Local\\Yarn\\Cache\\v6\\npm-@react-native-community-cli-4.10.1-3c1e74f55c004936368d3576d4c1da7d02b89904-integrity\\node_modules\\@react-native-community\\cli\\build\\commands\\init\\printRunInstructions.js'"
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Command failed: yarn add react-native --exact
    at checkExecSyncError (child_process.js:611:11)
    at execSync (child_process.js:647:15)
    at run (C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js:294:5)
    at createProject (C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
    at init (C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
    at Object.<anonymous> (C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules\react-native-cli\index.js:153:7)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 5028,
  stdout: null,
  stderr: null
}
Command `yarn add react-native --exact` failed.
1
please clean your post by adding code styling, and some text details about problem (not only logs) it will make easier to read for people who want to help you :)Salim

1 Answers

0
votes

It seems like a problem with permission with yarn/npm, EPERM: operation not permitted

Here's a article on what you could do to fix that, link, it can be your Antivirus or you have not enough permissions to C:\Users\sushant.patekar\AppData\Roaming\npm\node_modules

Also you can clear your npm packages, this answer can be helpful