[skip envinfo]
Windows 10, trying to run on Android.
Tried to run the newest NPM package of 0.57.0-rc.0 (Hoping it would fix AccessibilityInfo error)
I ran into this error instead:
BUNDLE [android, dev] ./index.js ββββββββββββββββ 0.0% (0/1)::ffff:127.0.0.1 - - [17/Aug/2018:11:25:37 +0000] "GET /index.delta?platform=android&dev=true&minify=false HTTP/1.1" 500 - "-" "okhttp/3.10.0"
error: bundling failed: Error: ENOENT: no such file or directory, lstat 'D:\Development\Action Menu\testVersion2\node_modules\react-native\scripts\index.js'
at Object.realpathSync (fs.js:1657:15)
at DependencyGraph.getSha1 (D:\Development\Action Menu\testVersion2\node_modules\metro\src\node-haste\DependencyGraph.js:236:29)
at D:\Development\Action Menu\testVersion2\node_modules\metro\src\Bundler.js:203:56
at Generator.next (<anonymous>)
at step (D:\Development\Action Menu\testVersion2\node_modules\metro\src\Bundler.js:11:657)
at D:\Development\Action Menu\testVersion2\node_modules\metro\src\Bundler.js:11:817
at <anonymous>
BUNDLE [android, dev] ./index.js ββββββββββββββββ 0.0% (0/1), failed.
Run:
react-native init --version="0.57.0-rc.0" testVersion
cd testVersion
react-native run-android
Have the same issue:
BUNDLE [android, dev] ./index.js ββββββββββββββββ 0.0% (0/1)::ffff:127.0.0.1 - - [17/Aug/2018:13:11:28 +0000] "GET /index.delta?platform=android&dev=true&minify=false HTTP/1.1" 500 - "-" "okhttp/3.10.0"
error: bundling failed: Error: ENOENT: no such file or directory, lstat 'D:\Developer\FrontEnd\test_057\node_modules\react-native\scripts\index.js'
at Object.realpathSync (fs.js:1430:7)
at DependencyGraph.getSha1 (D:\Developer\FrontEnd\test_057\node_modules\metro\src\node-haste\DependencyGraph.js:236:29)
at D:\Developer\FrontEnd\test_057\node_modules\metro\src\Bundler.js:203:56
at Generator.next (<anonymous>)
at step (D:\Developer\FrontEnd\test_057\node_modules\metro\src\Bundler.js:11:657)
at D:\Developer\FrontEnd\test_057\node_modules\metro\src\Bundler.js:11:817
at process._tickCallback (internal/process/next_tick.js:68:7)
Looks like something forget to bundle:

Hey folks thank for reporting, just double checked locally (on macOS) and it seems to me that it's not just Windows related (I'll remove the label) - I get this error /testVersion/node_modules/react-native/scripts/packager.sh: No such file or directory
My current hypotesis is that it's something outdated in the react-native run-xxx command, that instead of running the "latest" version of the command > node node_modules/react-native/local-cli/cli.js start runs an outdated version (that points to an old reference that is not there anymore).
Can you try to run npm start to manually start the packager and then in a second window run the react-native run-xxx command again?
You can use npm run start to start the dev server as an workaround.
And I also tried the android release build, works too.
The bundler, when spawned from "react-native run-android", looks in node_modules/react-native/scripts first, when I interpret the message correctly. See screenshot (unfortunatly I can not mark© text in that window):

When I use "react-native start", only the project-dir is searched (but 3 times??):
D:\vagrant\TestWin>react-native start
Scanning folders for symlinks in D:\vagrant\TestWin\node_modules (24ms)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Running Metro Bundler on port 8081. β
β β
β Keep Metro running while developing on any JS projects. Feel free to β
β close this tab and run your own Metro instance if you prefer. β
β β
β https://github.com/facebook/react-native β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Looking for JS files in
D:\vagrant\TestWin
D:\vagrant\TestWin
D:\vagrant\TestWin
Loading dependency graph, done.
BUNDLE [android, dev] ./index.js ββββββββββββββββ 100.0% (505/505), done.
::ffff:127.0.0.1 - - [17/Aug/2018:18:23:53 +0000] "GET /index.delta?platform=android&dev=true&minify=false HTTP/1.1" 200 - "-" "okhttp/3.10.0"
The good news is, that 0.57.0-rc.0 seems to fix #20353 (I would comment that there, however that issue is locked....)
Fixing this seems easy, when I replace https://github.com/facebook/react-native/blob/625c54d406bc3b40f7812a0276346b170a8a3b2b/local-cli/runAndroid/runAndroid.js#L365
with
const procConfig = {};
"react-native run-android" works (on windows), because otherwise the scripsDir is taken as projectRoot for the packager, since that is the default-value in https://github.com/facebook/react-native/blob/625c54d406bc3b40f7812a0276346b170a8a3b2b/local-cli/core/index.js#L59
At least if I understand the code correctly here, it's the first time I look into the react-native-code ;-)
Or maybe it should better be set to the root-Folder (explicitly)?
Hey Tim, thanks for the investigation, it seems to be in line with my hypothesis. Want to try and submit a PR for it? I feel like the same error will be found on the runIOS file
I tried what @timri did with the procConfig, but I still seem to get the same error:
bundling failed: Error: ENOENT: no such file or directory, lstat 'C:\Users\user\Documents\Test\node_modules\react-native\scripts\index.js'
at Object.realpathSync (fs.js:1657:15)
at DependencyGraph.getSha1 (C:\Users\user\Documents\Test\node_modules\metro\src\node-haste\DependencyGraph.js:236:29)
at C:\Users\user\Documents\Test\node_modules\metro\src\Bundler.js:203:56
at Generator.next (<anonymous>)
at step (C:\Users\user\Documents\Test\node_modules\metro\src\Bundler.js:11:657)
at C:\Users\user\Documents\Test\node_modules\metro\src\Bundler.js:11:817
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Edit: For some reason it didn't work for me the other day, but I just tested it today and it worked!
I'm on Windows 10 and Tried as @timri suggested
In react-native/local-cli/runAndroid/runAndroid.js
Line 365 in 625c54d
const procConfig = {cwd: scriptsDir};
with
const procConfig = {};
Worked for me..
macos. Same problem
node_modules/react-native/scripts/packager.sh: No such file or directory
Ok, so. I spent some time trying to understand what this is caused by and I found two "different" issues.
First one, basically on macOS when run-XXX get called this file gets executed launchPackager.command but this file references packager.sh which doesn't get bundled in the "node_module" version of react-native. I don't know why this happens but, yeah, I feel like packager.sh needs to be in the node_module. (cc @hramos maybe you know why it's not there?)
BTW, if I manually add the script, the command gets run properly and the Metro packager runs, but when it tries to bundle gives me back this error:
error: bundling failed: Error: ENOENT: no such file or directory, lstat '/private/tmp/RNTestProject/node_modules/react-native/index.js'
at Object.realpathSync (fs.js:1421:7)
at DependencyGraph.getSha1 (/private/tmp/RNTestProject/node_modules/metro/src/node-haste/DependencyGraph.js:236:29)
at /private/tmp/RNTestProject/node_modules/metro/src/Bundler.js:203:56
at Generator.next (<anonymous>)
at step (/private/tmp/RNTestProject/node_modules/metro/src/Bundler.js:11:657)
at /private/tmp/RNTestProject/node_modules/metro/src/Bundler.js:11:817
at process._tickCallback (internal/process/next_tick.js:68:7)
The second issue is related to the bundler, and I think I figured out why, or, at least, which commit may be related to the issue. Looking at the history for react-native/local-cli/cliEntry.js and react-native/local-cli/core/index.js one of the last commits is by @CompuIves and it seems to be related to the config that gets passed around the CLI.
Two more people who may have a better understading of why the run command fails to load the bundler with the right configuration are @janicduplessis and @rafeca.
Please fix it.
I can't build app on 0.55.4, 0.56.0, 0.57.0-rc.0
Waiting for stable version...
The package.sh is removed by one of my prs to make it test RNTester cross-platform, not sure why it affect this. Is it run-android use different method on winodws platform ?
Waiting for stable version...
@gengjiawen I don't think it "strictly" affects this issue, it's simply something that I found out during my investigation (so, like, a side issue) - but I think that then we need to reverse that change to re-add that file. Would it be possible?
Okay, I will create a pr, I removed it because I the file is redundant at that time.
@kelset PR created: https://github.com/facebook/react-native/pull/20751.
Also, as I mentioned earlier, this has workaround. You can use npm run start to start the dev server.
I checked the log again, looks like metro find the wrong project roots. cc @rafeca
Looking for JS files in
D:\Developer\FrontEnd\test_057\node_modules\react-native\scripts
D:\Developer\FrontEnd\test_057
D:\Developer\FrontEnd\test_057
I made the fix as discussed above on line 365 of runAndroid.js
It's does eliminate that error, but i'm left with this error
I'm getting a different error but related to Metro also (on Windows), after upgrading to 0.57.0-rc.0:
> react-native run-android
Scanning folders for symlinks in C:\Users\Gary\Documents\code\WonderSwipe\node_modules (29ms)
(node:21456) UnhandledPromiseRejectionWarning: Error: Cannot find module 'metro/src/blacklist'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\Users\Gary\Documents\code\WonderSwipe\rn-cli.config.js:3:19)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Module._compile (C:\Users\Gary\Documents\code\WonderSwipe\node_modules\pirates\lib\index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Object.newLoader [as .js] (C:\Users\Gary\Documents\code\WonderSwipe\node_modules\pirates\lib\index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:599:32)
(node:21456) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:21456) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm start hits the same error.
I am encountering the same issue as @dmead
React Native Environment Info:
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz
Memory: 1.13 GB / 7.93 GB
Binaries:
Yarn: 1.9.4 - C:\Users\ecumb\AppData\Roaming\npm\yarn.CMD
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.1.0.0 AI-173.4907809
@dmead @ericcumbee that error looks more like a babel miss-configuration, could you open a dedicated issue for that with a repro so that it can be investigated separately?
Still, the latest working version for windows platform is 0.55.4
With win10, after modify react-naitve/local-cli/runAndroid/runAndroid.js it stuck in here:
undefined is not a function (evaluating '_this._registerEvents()')
WebSocket
index.delta?platform=android&dev=true&minify=false:23619:28
connectToDevTools
index.delta?platform=android&dev=true&minify=false:25578:62
index.delta?platform=android&dev=true&minify=false:25363:38
loadModuleImplementation
index.delta?platform=android&dev=true&minify=false:180:14
guardedLoadModule
index.delta?platform=android&dev=true&minify=false:102:38
metroRequire
index.delta?platform=android&dev=true&minify=false:83:92
index.delta?platform=android&dev=true&minify=false:18466:20
loadModuleImplementation
index.delta?platform=android&dev=true&minify=false:180:14
guardedLoadModule
index.delta?platform=android&dev=true&minify=false:94:47
metroRequire
index.delta?platform=android&dev=true&minify=false:83:92
global code
index.delta?platform=android&dev=true&minify=false:79332:4
Looks like @rafeca committed a fix for this, we have cherry picked it and will be out with rc3.
In the meantime, can anyone test if master is now fixed?
@kelset, It dosen't work I replace local-cli/util/Config.js with @rafeca's committed version, but same error appeared.
@zenz I just tested locally myself and I can confirm that Rafael's commit fixes the run-XXX command starting the packager correctly (no triple search or errors). Both on iOS and Android.
To test them you need to git clone the repo, checkout to the 0.57 branch and then run ./scripts/test-manual-e2e.sh.
Probably you didn't clean your project properly while testing? Anyway, I think we'll proceed soon to release a rc3 version so that we can make sure it works fine for everyone.
@kelset I did what you said, no luck. and .sh file is only workable under *nix, not windows.
Fixed on rc3. I have verified using react-native init --version="0.57.0-rc.3" testRc3.
I installed "0.57.0-rc.3" and I still have the error registerevents which is mentioned by @dmead
Is it a clean install, or an upgraded project ?
Clean install
Can you provide a reproduce repo ?
Are you guys trying to repro on Windows?
On Sat, Aug 25, 2018, 3:27 AM Jiawen Geng notifications@github.com wrote:
Can you provide an repro repo ?
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/20712#issuecomment-415948449,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKzMquBoabdSAfpWaTvpHd98Xatzt1Fks5uUPxQgaJpZM4WBaWZ
.
@dmead I am using Windows 10 and still have this issue with 0.57.0-rc.3
I confirmed that 0.57.rc3 solved the problem. under windows 10.
@gengjiawen Here's the repo https://github.com/chakrihacker/testRc3 which I created with this react-native init --version="0.57.0-rc.3" testRc3
@chakrihacker I download your app and do react-native run-android, it's running well. I think you should check your system configuration.
My react-native-cli version is 2.0.1 and I am using react-native for past 6 months and my latest is on 0.55.4, what system configuration should I check?
I have the same error what @timri had
@chakrihacker did you use yarn for package management? or npm? which version?
I'm using yarn 1.7.0, and updating android build-tools to 27.0.3 and platform27.
I'm using yarn 1.9.4 with same android build-tools and platform.
I am getting this error ::ffff:127.0.0.1 - - [27/Aug/2018:11:08:16 +0000] "GET /index.delta?platform=android&dev=true&minify=false&deltaBundleId=10e3175f5899423e HTTP/1.1" 200 - "-" "okhttp/3.10.0"
@chakrihacker Did you get this resolved?
https://github.com/facebook/react-native/issues/20712#issuecomment-416191446
It's working, you can close this issue
Most helpful comment
Hey folks thank for reporting, just double checked locally (on macOS) and it seems to me that it's not just Windows related (I'll remove the label) - I get this error
/testVersion/node_modules/react-native/scripts/packager.sh: No such file or directoryMy current hypotesis is that it's something outdated in the
react-native run-xxxcommand, that instead of running the "latest" version of the command> node node_modules/react-native/local-cli/cli.js startruns an outdated version (that points to an old reference that is not there anymore).Can you try to run
npm startto manually start the packager and then in a second window run thereact-native run-xxxcommand again?