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

"yarn run eject" ejected succcessfully, but followed by "The batch file cannot be found." #2030

Closed
phoa opened this issue Apr 25, 2017 · 17 comments

Comments

@phoa
Copy link

phoa commented Apr 25, 2017

Can you reproduce the problem with latest npm?

Yes.

Description

I started a fresh project with create-react-app. yarn start and yarn run build runs as expected. However, when running yarn run eject, it shows Ejected successfully!, but followed by

Ejected successfully!

Please consider sharing why you ejected in this survey:
  http://goo.gl/forms/Bi6CZjk1EqsdelXk1

The batch file cannot be found.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I also tried npm run eject where it shows more error message:

Ejected successfully!

Please consider sharing why you ejected in this survey:
  http://goo.gl/forms/Bi6CZjk1EqsdelXk1

The batch file cannot be found.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testcra7@0.1.0 eject: `react-scripts eject`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testcra7@0.1.0 eject script 'react-scripts eject'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the testcra7 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts eject
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs testcra7
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls testcra7
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\path\to\npm-cache\_logs\2017-04-25T05_03_07_216Z-debug.log

Should I worry about this?
yarn start and yarn run build still run fine after eject tho.

Expected behavior

No error message after Ejected successfully!

Actual behavior

Got error message after Ejected successfully!

Environment

  1. npm ls react-scripts (if you haven’t ejected): react-scripts@0.9.5

  2. node -v: 6.10.2

  3. npm -v: 4.5.0

  4. Operating system: Windows 7 (behind corporate firewall)

  5. Browser and version: Chrome 53.0.2785.116

@gaearon
Copy link
Contributor

gaearon commented May 1, 2017

Can you share this “complete log”?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\path\to\npm-cache\_logs\2017-04-25T05_03_07_216Z-debug.log

@phoa
Copy link
Author

phoa commented May 2, 2017

yeap, here it is.

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\apps\\nodejs\\node.exe',
1 verbose cli   'C:\\apps\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'eject' ]
2 info using npm@4.5.0
3 info using node@v6.10.2
4 verbose run-script [ 'preeject', 'eject', 'posteject' ]
5 info lifecycle testcra7@0.1.0~preeject: testcra7@0.1.0
6 silly lifecycle testcra7@0.1.0~preeject: no script for preeject, continuing
7 info lifecycle testcra7@0.1.0~eject: testcra7@0.1.0
8 verbose lifecycle testcra7@0.1.0~eject: unsafe-perm in lifecycle true
9 verbose lifecycle testcra7@0.1.0~eject: PATH: C:\apps\nodejs\node_modules\npm\bin\node-gyp-bin;C:\path\to\github\testcra7\node_modules\.bin;"C:\apps\curl\bin";"C:\apps\jdk8u51x64";"C:\apps\jdk8u51x64\bin";"C:\apps\PythonPortable\App";"C:\apps\nodejs";"C:\apps\GitPortable\bin";"C:\apps\GitPortable\usr\bin";"C:\apps\Atom\resources\app\apm\bin";C:\apps\cmder\bin;C:\apps\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\apps\cmder\vendor\conemu-maximus5;C:\apps\cmder\vendor\conemu-maximus5\ConEmu;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Java\jre1.5.0_15\bin;C:\Program Files (x86)\Wave Systems Corp\bin\;C:\Program Files\Wave Systems Corp\Wave TSS\bin\;C:\Program Files (x86)\1E\NomadBranch\;C:\Program Files\TortoiseSVN\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Java\jre1.5.0_15\bin;C:\Program Files (x86)\Wave Systems Corp\bin\;C:\Program Files\Wave Systems Corp\Wave TSS\bin\;C:\Program Files (x86)\1E\NomadBranch\;C:\apps\curl\bin;C:\apps\jdk8u51x64;C:\apps\PythonPortable\App;C:\apps\nodejs;C:\apps\GitPortable\bin;C:\apps\GitPortable\usr\bin;C:\path\to\AppData\Local\atom\bin;C:\apps\GitPortable\usr\bin;C:\apps\GitPortable\usr\share\vim\vim74;C:\apps\cmder\
10 verbose lifecycle testcra7@0.1.0~eject: CWD: C:\path\to\github\testcra7
11 silly lifecycle testcra7@0.1.0~eject: Args: [ '/d /s /c', 'react-scripts eject' ]
12 silly lifecycle testcra7@0.1.0~eject: Returned: code: 1  signal: null
13 info lifecycle testcra7@0.1.0~eject: Failed to exec eject script
14 verbose stack Error: testcra7@0.1.0 eject: `react-scripts eject`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\apps\nodejs\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\apps\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:886:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid testcra7@0.1.0
16 verbose cwd C:\path\to\github\testcra7
17 verbose Windows_NT 6.1.7601
18 verbose argv "C:\\apps\\nodejs\\node.exe" "C:\\apps\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "eject"
19 verbose node v6.10.2
20 verbose npm  v4.5.0
21 error code ELIFECYCLE
22 error errno 1
23 error testcra7@0.1.0 eject: `react-scripts eject`
23 error Exit status 1
24 error Failed at the testcra7@0.1.0 eject script 'react-scripts eject'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the testcra7 package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     react-scripts eject
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs testcra7
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls testcra7
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

@gaearon
Copy link
Contributor

gaearon commented May 9, 2017

This is very odd. I don't know what's causing this. 😞

@viankakrisna
Copy link
Contributor

maybe related? http://stackoverflow.com/questions/26240414/jenkins-deleting-batch-file-before-its-completed it's jenkins but the symptoms pretty similar

@phoa do you able to consistently replicate this problem? eg. tried to create another CRA instance and eject it?

@phoa
Copy link
Author

phoa commented May 12, 2017

@viankakrisna It consistently happens when I eject (10 tries). Same thing happens when I tested it on my colleague's computer.
The ejected package runs fine tho. So far I do not see any problem with it.

I kinda suspect that this may be caused by some corporate settings applied to our computers.
This is not happening with my personal computer.

@jasenf
Copy link

jasenf commented May 19, 2017

I get the same error, running Windows 10. Exact same entries in my log file.

@ro-savage
Copy link
Contributor

This is happening in windows CI for PR #2400

Looks like it might be to do with running the latest version of yarn (0.24.5) as thats the only change that the PR makes

@jazzfog
Copy link

jazzfog commented Jun 19, 2017

Got this message too, Windows 10.

@cheryllium
Copy link

Got same error, Windows 8.

@mihir0x69
Copy link

Got same error on windows 10. FWIW, sharing the logs too.

$ npm run eject

> asdfasdfasdf@0.1.0 eject C:\Users\mihir.karandikar\Source\Repos\DWH\asdfasdfasdf\src\asdfasdfasdf\Client\asdfasdfasdf
> react-scripts eject

? Are you sure you want to eject? This action is permanent. (y/N) y
? Are you sure you want to eject? This action is permanent. Yes
Ejecting...

Copying files into C:\Users\mihir.karandikar\Source\Repos\DWH\asdfasdfasdf\src\asdfasdfasdf\Client\asdfasdfasdf
  Adding \config\env.js to the project
  Adding \config\paths.js to the project
  Adding \config\polyfills.js to the project
  Adding \config\webpack.config.dev.js to the project
  Adding \config\webpack.config.prod.js to the project
  Adding \config\webpackDevServer.config.js to the project
  Adding \config\jest\cssTransform.js to the project
  Adding \config\jest\fileTransform.js to the project
  Adding \scripts\build.js to the project
  Adding \scripts\start.js to the project
  Adding \scripts\test.js to the project

Updating the dependencies
  Removing react-scripts from devDependencies
  Adding autoprefixer to devDependencies
  Adding babel-core to devDependencies
  Adding babel-eslint to devDependencies
  Adding babel-jest to devDependencies
  Adding babel-loader to devDependencies
  Adding babel-preset-react-app to devDependencies
  Adding babel-runtime to devDependencies
  Adding case-sensitive-paths-webpack-plugin to devDependencies
  Adding chalk to devDependencies
  Adding css-loader to devDependencies
  Adding dotenv to devDependencies
  Adding eslint to devDependencies
  Adding eslint-config-react-app to devDependencies
  Adding eslint-loader to devDependencies
  Adding eslint-plugin-flowtype to devDependencies
  Adding eslint-plugin-import to devDependencies
  Adding eslint-plugin-jsx-a11y to devDependencies
  Adding eslint-plugin-react to devDependencies
  Adding extract-text-webpack-plugin to devDependencies
  Adding file-loader to devDependencies
  Adding fs-extra to devDependencies
  Adding html-webpack-plugin to devDependencies
  Adding jest to devDependencies
  Adding object-assign to devDependencies
  Adding postcss-flexbugs-fixes to devDependencies
  Adding postcss-loader to devDependencies
  Adding promise to devDependencies
  Adding react-dev-utils to devDependencies
  Adding react-error-overlay to devDependencies
  Adding style-loader to devDependencies
  Adding sw-precache-webpack-plugin to devDependencies
  Adding url-loader to devDependencies
  Adding webpack to devDependencies
  Adding webpack-dev-server to devDependencies
  Adding webpack-manifest-plugin to devDependencies
  Adding whatwg-fetch to devDependencies

Updating the scripts
  Replacing "react-scripts start" with "node scripts/start.js"
  Replacing "react-scripts build" with "node scripts/build.js"
  Replacing "react-scripts test" with "node scripts/test.js"

Configuring package.json
  Adding Jest configuration
  Adding Babel preset
  Adding ESLint configuration

Running yarn...
yarn install v0.24.5
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.0.17: The platform "win32" is incompatible with this module.
info "fsevents@1.0.17" is an optional dependency and failed compatibility check.          Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 17.93s.
Ejected successfully!

Please consider sharing why you ejected in this survey:
  http://goo.gl/forms/Bi6CZjk1EqsdelXk1

The batch file cannot be found.

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\         node_modules\\npm\\bin\\npm-cli.js" "run" "eject"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! data-migrator-ui@0.1.0 eject: `react-scripts eject`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the asdfasdfasdf@0.1.0 eject script 'react-scripts eject'         .
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the asdfasdfasdf pack         age,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts eject
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs asdfasdfasdf
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls asdfasdfasdf
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\mihir.karandikar\Source\Repos\DWH\asdfasdfasdf\src\asdfasdfasdf\Client\asdfasdfasdf\npm-debug.         log

@gaearon
Copy link
Contributor

gaearon commented Jun 23, 2017

Does anyone want to look into why this happens? I don't know enough about Windows.

@gaearon
Copy link
Contributor

gaearon commented Jun 26, 2017

I can't reproduce this on a Windows laptop. Tried both Cmd and PowerShell, both npm and yarn.
Can anybody who reproduces this think more about what makes your setup special?

@phoa
Copy link
Author

phoa commented Jun 27, 2017

@gaearon - my setup is as follow:

  • using standalone NodeJS Windows 64 Binary 6.10.2 and NPM 4.6.1 from NPM Github Release Page
  • yarn is installed via npm install -g yarn
  • i'm behind corporate-proxy, so my NPM and Yarn have proxy and https-proxy config setup
  • there are corporate-specific scripts running behind the scene, which may or may not contribute to the error

A colleague of mine has the same setup, and he also got the same error message.

Up till now, the ejected version is still running fine without problem for me, despite the error message during eject.

@tchojnacki
Copy link

Same, works fine despite the message.
@gaearon

  • Windows 8.1
  • Node v7.5.0 and NPM 4.1.2
  • yarn installed using .msi
  • firewall disabled completely

Can't find anything special about my setup apart from that.

@K4bl0-Skat3R
Copy link

same prob... any solution ... I dont running yarn together :(

@lu-xuelei
Copy link

lu-xuelei commented Aug 20, 2018

New to react-native and facing the same problem. Any update to this in the last one year?

PS: > node -v
v8.10.0
PS: > npm -v
6.0.1

@kingdiamond666
Copy link

I just had the same problem...same err messages, same debug log. If you are using Git make sure you do a commit before running eject, it worked for me!

@lock lock bot locked and limited conversation to collaborators Jan 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests