1
votes

Hi i have problem with initialize new react-native project. I have already check some similar problems from stackoverflow, but i didn't find anything that helps.

When i try to init new project using "react-native init test --verbose" command (--verbose for more details) i get an error:

debug Installing template from react-native@latest
yarn add v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "react-router-dom@^4.2.2".
warning "react-scripts > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@*".
warning "react-scripts > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@*".
warning " > [email protected]" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0".
warning "react-scripts > @typescript-eslint/eslint-plugin > @typescript-eslint/[email protected]" has unmet peer dependency "typescript@*".
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > [email protected]" has unmet peer dependency "eslint@^4.19.1 || ^5.3.0".
warning "eslint-config-airbnb > [email protected]" has unmet peer dependency "eslint@^4.19.1 || ^5.3.0".
warning " > [email protected]" has unmet peer dependency "[email protected]".
warning " > [email protected]" has unmet peer dependency "[email protected]".
warning " > [email protected]" has incorrect peer dependency "[email protected]".
warning " > [email protected]" has unmet peer dependency "eslint@>=5.0.0".
warning " > [email protected]" has unmet peer dependency "[email protected] - 6.x".
warning " > [email protected]" has unmet peer dependency "eslint@^3 || ^4 || ^5 || ^6".
warning " > [email protected]" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0".
warning "react-native > [email protected]" has unmet peer dependency "@babel/core@*".
[4/4] Building fresh packages...

success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
Done in 13.10s.
debug Getting config from C:\Users\Lukasz\AppData\Local\Temp\rncli-init-template-8Gdikl\node_modules\react-native\template.config.js
error Error: Cannot find module 'C:\Users\Lukasz\AppData\Local\Temp\rncli-init-template-8Gdikl\node_modules\react-native\template.config'
Require stack:
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli\build\commands\init\template.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli\build\commands\init\init.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli\build\commands\init\index.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli\build\commands\index.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli\build\cliEntry.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli\build\index.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli\build\bin.js
error EBUSY: resource busy or locked, rmdir 'C:\xampp\htdocs\projekty\19-08-sie\test'
Error: EBUSY: resource busy or locked, rmdir 'C:\xampp\htdocs\projekty\19-08-sie\test'
    at Object.rmdirSync (fs.js:693:3)
    at rmdirSync (C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\fs-extra\lib\remove\rimraf.js:276:13)
    at Object.rimrafSync [as removeSync] (C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\fs-extra\lib\remove\rimraf.js:252:7)
    at Object.initialize [as func] (C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli\build\commands\init\init.js:292:26)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)

I have tried:
- clear npm cache
- reinstall react-native

2
does you solve the problem?mansour lotfi

2 Answers

1
votes

I had the same error. Install the react-native-cli for works.

yarn global add react-native-cli

or

npm i -g react-native-cli

0
votes

The problem is the location of server xampp. All first level folders under C:// need Admin permissions to update or remove, i recomended install xampp on another place, or run you console with admin privileged.