Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch file not found when ejecting? #367

Closed
baba43 opened this issue Aug 17, 2017 · 4 comments
Closed

Batch file not found when ejecting? #367

baba43 opened this issue Aug 17, 2017 · 4 comments

Comments

@baba43
Copy link

baba43 commented Aug 17, 2017

Is this a bug report?

Yes.

Can you also reproduce the problem with npm 4.x?

Yes.

Environment

  1. node -v: 8.3.0
  2. npm -v: 5.3.0
  3. yarn --version (if you use Yarn): 0.27.5
  4. npm ls react-scripts (if you haven’t ejected): 1.1.0

Then, specify:

  1. Operating system: Windows

Steps to Reproduce

  1. Install latest create-react-native-app
  2. Create new App
  3. Try to run eject

Expected Behavior

Ejecting works without any problem.

Actual Behavior

The script fails at some point with unknown results. I have some troubles (#364) with getting the Scripts to run after this eject but I'm not 100% sure if that is related to this problem.

However my console says:

Writing your selections to app.json...
Wrote to app.json, please update it manually in the future.
Scanning 723 folders for symlinks in D:\projekte\Test\node_modules (30ms)
Generating the iOS folder.
Generating the Android folder.
Successfully copied template native code.
Babel preset changed to `babel-preset-react-native-stage-0/decorator-support`.
Updating your yarn scripts in package.json...
Your package.json is up to date!
Adding platform-specific entry points...
Added new entry points!

Note that using `yarn start` will now require you to run Xcode and/or
Android Studio to build the native code for your project.
Removing node_modules...
Installing packages with yarn...
yarn add v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ babel-preset-react-native-stage-0@1.0.1
Done in 17.45s.
Ejected successfully!
Please consider letting us know why you ejected in this survey:
  https://goo.gl/forms/iD6pl218r7fn9N0d2
Die Batchdatei kann nicht gefunden werden.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Test@0.1.0 eject: `react-native-scripts eject`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the Test@0.1.0 eject script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\*\AppData\Roaming\npm-cache\_logs\2017-08-17T08_02_48_467Z-debug.log

Process finished with exit code 1

And the related log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'eject',
1 verbose cli   '--scripts-prepend-node-path=auto' ]
2 info using npm@5.3.0
3 info using node@v8.3.0
4 verbose run-script [ 'preeject', 'eject', 'posteject' ]
5 info lifecycle Test@0.1.0~preeject: Test@0.1.0
6 info lifecycle Test@0.1.0~eject: Test@0.1.0
7 verbose lifecycle Test@0.1.0~eject: unsafe-perm in lifecycle true
8 verbose lifecycle Test@0.1.0~eject: PATH: {...}
9 verbose lifecycle Test@0.1.0~eject: CWD: D:\projekte\Test
10 silly lifecycle Test@0.1.0~eject: Args: [ '/d /s /c', 'react-native-scripts eject' ]
11 silly lifecycle Test@0.1.0~eject: Returned: code: 1  signal: null
12 info lifecycle Test@0.1.0~eject: Failed to exec eject script
13 verbose stack Error: Test@0.1.0 eject: `react-native-scripts eject`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid Test@0.1.0
15 verbose cwd D:\projekte\Test
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "eject" "--scripts-prepend-node-path=auto"
18 verbose node v8.3.0
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error Test@0.1.0 eject: `react-native-scripts eject`
22 error Exit status 1
23 error Failed at the Test@0.1.0 eject script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'eject',
1 verbose cli   '--scripts-prepend-node-path=auto' ]
2 info using npm@5.3.0
3 info using node@v8.3.0
4 verbose run-script [ 'preeject', 'eject', 'posteject' ]
5 info lifecycle Test@0.1.0~preeject: Test@0.1.0
6 info lifecycle Test@0.1.0~eject: Test@0.1.0
7 verbose lifecycle Test@0.1.0~eject: unsafe-perm in lifecycle true
8 verbose lifecycle Test@0.1.0~eject: PATH: {...}
9 verbose lifecycle Test@0.1.0~eject: CWD: D:\projekte\Test
10 silly lifecycle Test@0.1.0~eject: Args: [ '/d /s /c', 'react-native-scripts eject' ]
11 silly lifecycle Test@0.1.0~eject: Returned: code: 1  signal: null
12 info lifecycle Test@0.1.0~eject: Failed to exec eject script
13 verbose stack Error: Test@0.1.0 eject: `react-native-scripts eject`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid Test@0.1.0
15 verbose cwd D:\projekte\Test
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "eject" "--scripts-prepend-node-path=auto"
18 verbose node v8.3.0
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error Test@0.1.0 eject: `react-native-scripts eject`
22 error Exit status 1
23 error Failed at the Test@0.1.0 eject script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
@brentvatne
Copy link
Member

can't repro this, works as expected for me. try deleting node_modules, installing them again, then running npm run eject again

@zzq392342084
Copy link

if eject success,what dose the project folder structure looks like ?

@react-newbie
Copy link

i got the same issue....has anyone found any solution?!

@NotAdrian
Copy link

I just tried running eject on Windows 7 64-bit. Since the cmd.exe (The command line of windows 7) doesent read batchfiles in total into memory to execute them and is reading and executing the commands one by one after each other the Error is raised.
Somewhere in the later steps when node_modules is being deleted it also deletes the dependency which is implementing the batch file midway in the eject process. But since the Windows 7 console needs to read it again to execute the next command or to know that the there are no other commands left to execute it is throwing the error message

As far as I heared the setup should be working in Windows 10 since the comandline there was completly reworked.
But dont worry fellow windows 7 people. If you know your way around linux you can just create a Virtualbox or Vmware Machine, load a free Version of Ubuntu onto it and execute eject inside your project there to push the result into your online git repository again. That worked for me. (The only reason you can do it like this without corrupting your workflow is since you dont have to execute it again, it's just a one time job as far as I know)

(Or you could just install a another terminal that is NOT being hooked or just a header of the normal cmd.exe)

I hope I brought some light into this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants