You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The server used to build our app doesn't have npx installed and we would prefer not installing it. Is there any benefit to using npx instead of just calling the react-native binary directly? The one in node_modules/.bin/react-native? Seems to me it accomplishes the same thing without the need for npx.
npx binary is assumed to be bundled with Node, that's why we use it. Calling node_modules/.bin/react-native is not easily portable in monorepos and across OSes (like Windows). Did you specifically remove it in your environment?
@thymikee We noticed this specifically at Facebook in an app that consumes React Native from open source rather than our internal version and therefore is using the cli packages which our internal version doesn't. We do not have npx or internet access available there. I think the offending line is this one:
Could we provide a fallback or a way to configure this? What if we invoked node instead by taking a look at something like require.resolve('react-native/' + require('react-native/package.json').bin)?
Activity
thymikee commentedon Dec 13, 2019
npxbinary is assumed to be bundled with Node, that's why we use it. Callingnode_modules/.bin/react-nativeis not easily portable in monorepos and across OSes (like Windows). Did you specifically remove it in your environment?cpojer commentedon Jan 8, 2020
@thymikee We noticed this specifically at Facebook in an app that consumes React Native from open source rather than our internal version and therefore is using the cli packages which our internal version doesn't. We do not have npx or internet access available there. I think the offending line is this one:
cli/packages/platform-android/native_modules.gradle
Line 187 in 4fefe6b
Could we provide a fallback or a way to configure this? What if we invoked node instead by taking a look at something like
require.resolve('react-native/' + require('react-native/package.json').bin)?thymikee commentedon Jan 8, 2020
@cpojer we'll migrate off of npx, it's causing too many issues.
ikedm commentedon Jan 14, 2020
@thymikee do you know how long before we have access to the non-npx version? This is preventing us from upgrading to RN 0.61 :(
ikedm commentedon Jan 30, 2020
@grabbou, thanks for working on this! How does your fix relates to this:
https://github.com/facebook/react-native/blob/1fb815ed4314c1396999e64354ca0b5d4ed83663/react.gradle#L102 ?
Is this a separate issue?
grabbou commentedon Apr 14, 2020
@dalmendray, we're removing that as of 0.63. See the linked #28415 for discussion.