| #
6d2045be |
| 26-Oct-2018 |
James Ide <[email protected]> |
[scripts] Run `npx` through `yarn exec` when run via npm instead of Yarn
`npm publish` would fail because `npx` would install `tsc` from npm instead of using the copy installed in the workspace root
[scripts] Run `npx` through `yarn exec` when run via npm instead of Yarn
`npm publish` would fail because `npx` would install `tsc` from npm instead of using the copy installed in the workspace root's `node_modules/.bin` directory. In contrast, Yarn adds the workspace root's `.bin` directory and cwd's `.bin` directory to `$PATH` so we find our locally installed copy of `tsc`.
To remedy this difference between Yarn and npm, we want to set up `$PATH` the same way Yarn does even when using npm. Yarn exposes a command called `yarn exec` that does this, so in `expo-module-scripts` we now use `yarn exec -- npx` instead of `npx` when we detect that we're run via npm instead of Yarn.
Test plan: run `npm pack` in the expo package and verify it works.
show more ...
|