re-start icon indicating copy to clipboard operation
re-start copied to clipboard

Command failed: yarn add [email protected]

Open abakumov-v opened this issue 6 years ago • 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:

  1. run command react-native init MyProjectName --template everywhere --version="0.44.2"
  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 " > [email protected]" has incorrect peer dependency "[email protected]".
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 [email protected]
    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?

abakumov-v avatar Nov 05 '17 20:11 abakumov-v

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 avatar Nov 06 '17 05:11 amoghbanta

@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: screenshot

abakumov-v avatar Nov 09 '17 07:11 abakumov-v

That seems to be an issue with Yarn on Windows. cc @piranna, any idea about this?

amoghbanta avatar Nov 09 '17 08:11 amoghbanta

I'm not a Windows or yarn user, sorry :-(

piranna avatar Nov 09 '17 09:11 piranna

@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?

abakumov-v avatar Nov 09 '17 11:11 abakumov-v

@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?

abakumov-v avatar Nov 11 '17 20:11 abakumov-v

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)?

abakumov-v avatar Nov 11 '17 20:11 abakumov-v

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:

  1. run command react-native init MyProjectName --template everywhere --version="0.44.2"
  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 " > [email protected]" has incorrect peer dependency "[email protected]".
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 [email protected]
    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?

SG-XM avatar Apr 16 '19 08:04 SG-XM

  • react-native version: 0.44.2

Really? Why are you using such an obsolete version?

piranna avatar Apr 16 '19 08:04 piranna

  • 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

SG-XM avatar Apr 16 '19 08:04 SG-XM

react-native-cli: 2.0.1

The same here. Please use a consistent environment with all dependencies updated to their latests version.

piranna avatar Apr 16 '19 08:04 piranna

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!

SG-XM avatar Apr 16 '19 08:04 SG-XM

@piranna the react-native-cli: 2.0.1 is the latest i think.

iPloDev avatar May 17 '19 16:05 iPloDev