Command failed: yarn add react-native@0.45.1
abakumov-v opened this issue · 13 comments
Step 1: Are you in the right place?
I hope.
Step 2: Describe your environment
- template version : 0.44.2
- react-native version: 0.44.2
- OS : Windows 10
- Platform causing error: all
- react-native-cli version: 5.5.1
- yarn version: 1.3.2
- node.js version: 8.9.0
- npm version: 5.5.1
Step 3: Describe the problem (try to include screenshots):
When trying install this by command
react-native init MyProjectName --template everywhere --version="0.44.2"
I'm getting error - see below.
Steps to reproduce:
- run command
react-native init MyProjectName --template everywhere --version="0.44.2"
- get error:
error An unexpected error occurred: "EPERM: operation not permitted, copyfile 'C:\\Users\\Home\\AppData\\Local\\Yarn\\cache\\v1\\npm-react-native-0.45.1-b3283c4a88233421f9c662a2ff1a4ccc8a9f07c0\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar' -> 'D:\\Projects\\Git\\Finance.Mobile\\mobile\\node_modules\\react-native\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar'".
info If you think this is a bug, please open a bug report with the information provided in "D:\\Projects\\Git\\Finance.Mobile\\mobile\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
warning " > react-native@0.44.2" has incorrect peer dependency "react@16.0.0-alpha.6".
error An unexpected error occurred: "EPERM: operation not permitted, lstat 'D:\\Projects\\Git\\Finance.Mobile\\mobile\\node_modules\\react-native\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar'".
Failed to clean up template temp files in node_modules/react-native-template-everywhere. This is not a critical error, you can work on your app.
child_process.js:644
throw err;
^
Error: Command failed: yarn add react-native@0.45.1
at checkExecSyncError (child_process.js:601:13)
at execSync (child_process.js:641:13)
at installTemplateDependencies (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:192:7)
at createFromRemoteTemplate (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:147:5)
at createProjectFromTemplate (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:88:5)
at generateProject (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/init/init.js:80:3)
at Object.init (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/init/init.js:52:5)
at run (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:302:7)
at createProject (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3)
at init (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
Observed Results:
- Throw exception (see above) when I'm try to install this package
Expected Results:
- Installing template without errors.
May be, I'm doing something wrong?
Hey, @Valeriy1991
I'll need some time to look into this. I've not been able to test it on windows. Meanwhile, you can use
react-native init MyProjectName --template re-start
cd MyProjectName
node scripts/additionalDependencies.js
rest everything will be same as the README says.
@amoghbanta hi! I'v tryed this commands as you recommended:
react-native init MyProjectName --template re-start
cd MyProjectName
node scripts/additionalDependencies.js
On 3rd command (node scripts/additionalDependencies.js
) I've get an other error:
That seems to be an issue with Yarn on Windows.
cc @piranna, any idea about this?
I'm not a Windows or yarn user, sorry :-(
@amoghbanta why do you think that problem with Yarn? The error has occured in electron, isn't it? Can I install re-start template without yarn?
@amoghbanta Hi! I found that after running this commands:
react-native init MyProjectName --template re-start
cd MyProjectName
node scripts/additionalDependencies.js
and when failed last 3rd command, in the folder MyProjectName
I'm have devDependencies.json
with this content:
{
"react-scripts": "1.0.14",
"electron": "1.6.11",
"babel-plugin-transform-react-remove-prop-types": "0.4.10"
}
But in the repository this file contains much more dependencies: https://github.com/react-everywhere/re-start/blob/master/devDependencies.json
May be, an error occured because of this short contents of file devDependencies.json
?
Also I found that next files is missed:
scripts/build.js
scripts/start.js
- folder
config
with nested js-files for webpack index.web.js
eslintrc
After adding this files I was able to run the application 😅 But I'm confused that the blue background is not stretched to full screen:
All it's okay with this app (for web)?
Step 1: Are you in the right place?
I hope.
Step 2: Describe your environment
- template version : 0.44.2
- react-native version: 0.44.2
- OS : Windows 10
- Platform causing error: all
- react-native-cli version: 5.5.1
- yarn version: 1.3.2
- node.js version: 8.9.0
- npm version: 5.5.1
Step 3: Describe the problem (try to include screenshots):
When trying install this by command
react-native init MyProjectName --template everywhere --version="0.44.2"
I'm getting error - see below.Steps to reproduce:
- run command
react-native init MyProjectName --template everywhere --version="0.44.2"
- get error:
error An unexpected error occurred: "EPERM: operation not permitted, copyfile 'C:\\Users\\Home\\AppData\\Local\\Yarn\\cache\\v1\\npm-react-native-0.45.1-b3283c4a88233421f9c662a2ff1a4ccc8a9f07c0\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar' -> 'D:\\Projects\\Git\\Finance.Mobile\\mobile\\node_modules\\react-native\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar'". info If you think this is a bug, please open a bug report with the information provided in "D:\\Projects\\Git\\Finance.Mobile\\mobile\\yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command. warning " > react-native@0.44.2" has incorrect peer dependency "react@16.0.0-alpha.6". error An unexpected error occurred: "EPERM: operation not permitted, lstat 'D:\\Projects\\Git\\Finance.Mobile\\mobile\\node_modules\\react-native\\local-cli\\templates\\HelloWorld\\android\\gradle\\wrapper\\gradle-wrapper.jar'". Failed to clean up template temp files in node_modules/react-native-template-everywhere. This is not a critical error, you can work on your app. child_process.js:644 throw err; ^ Error: Command failed: yarn add react-native@0.45.1 at checkExecSyncError (child_process.js:601:13) at execSync (child_process.js:641:13) at installTemplateDependencies (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:192:7) at createFromRemoteTemplate (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:147:5) at createProjectFromTemplate (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/generator/templates.js:88:5) at generateProject (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/init/init.js:80:3) at Object.init (D:/Projects/Git/Finance.Mobile/mobile/node_modules/react-native/local-cli/init/init.js:52:5) at run (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:302:7) at createProject (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:249:3) at init (C:\Users\Home\AppData\Roaming\npm\node_modules\react-native-cli\index.js:200:5)
Observed Results:
- Throw exception (see above) when I'm try to install this package
Expected Results:
- Installing template without errors.
May be, I'm doing something wrong?
I face with the same problem in windows10, but I couldn't find any solution in Goolge, even in 2019. Did you solve this problem?
- react-native version: 0.44.2
Really? Why are you using such an obsolete version?
- react-native version: 0.44.2
Really? Why are you using such an obsolete version?
Actually, I am using new version, but this problem still exist.
PS D:\RNApp\MyApp> java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) Client VM (build 25.191-b12, mixed mode)
PS D:\RNApp\MyApp> react-native --version
react-native-cli: 2.0.1
react-native: 0.59.4
PS D:\RNApp\MyApp> node --version
v8.9.4
react-native-cli: 2.0.1
The same here. Please use a consistent environment with all dependencies updated to their latests version.
Sorry, can you elaborate on it, what environment and what dependencies? I am a native app developer and this is the first time I try react. Thanks!