expo: Expo Modules - Bug NPM on trying to `npx create-expo-module`
Summary
I’m trying to build a native-module API with expo-modules and i tried to execute npx create-expo-module and after that, the module started, but once reach Installing Module Dependency, the npm ‘spawn’ error occurs.
√ What is the name of the npm package? … pdv-integration √ What is the native module name? … PdvIntegration √ How would you describe the module? … My new module √ What is the Android package name? … expo.modules.pdvintegration √ What is the name of the package author? … jba √ What is the email address of the author? … jrbarroz04 √ What is the URL to the author’s GitHub profile? … √ What is the URL for the repository? … http://
✔ Downloaded module template from npm
✔ Created the module from template files
✔ Created an empty Git repository
✖ Installing module dependencies
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\jrbar\AppData\Local\npm-cache_npx\62900f925a4b91dc\node_modules@expo\spawn-async\build\spawnAsync.js:41:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at cp.emit (C:\Users\jrbar\AppData\Local\npm-cache_npx\62900f925a4b91dc\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)
…
at spawnAsync (C:\Users\jrbar\AppData\Local\npm-cache_npx\62900f925a4b91dc\node_modules@expo\spawn-async\build\spawnAsync.js:7:23)
at installDependencies (C:\Users\jrbar\AppData\Local\npm-cache_npx\62900f925a4b91dc\node_modules\create-expo-module\build\packageManager.js:9:37)
at C:\Users\jrbar\AppData\Local\npm-cache_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:74:56
at newStep (C:\Users\jrbar\AppData\Local\npm-cache_npx\62900f925a4b91dc\node_modules\create-expo-module\build\utils.js:21:22)
at Command.main (C:\Users\jrbar\AppData\Local\npm-cache_npx\62900f925a4b91dc\node_modules\create-expo-module\build\create-expo-module.js:73:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
pid: 10300,
output: [ ‘’, ‘’ ],
stdout: ‘’,
stderr: ‘’,
status: 1,
signal: null
}
What platform(s) does this occur on?
Android
SDK Version
46
Environment
expo-env-info 1.0.5 environment info:
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-213.7172.25.2113.9123335
Minimal reproducible example
npx create-expo-module
- Accept Everything and Wait for installation
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 15
- Comments: 46 (5 by maintainers)
I found a solution, even if I don’t think it will work for everyone.
So, I noticed that by running
npx create-expo-module@latest new-react-native-moduleon another environment with WSL2 and Yarn 1.22 it worked without any issue.I downgraded Yarn to classic with
yarn set version classicon my MacOS environment, re-ran thecreate-expo-module commandand it went correctly through all the steps.I can confirm, too, that using
yarn v1works.yarn set version classicwill do the trick and thenyarn create expo-module some-nameWhat worked for me was using yarn:
yarn create expo-module new-expo-module. Take a look at https://www.npmjs.com/package/create-expo-module.I hope it helps 😃
my problem was that
rsyncwasn’t installed in my systemUsing
create-expo-module@latestdidn’t work for me eitherWent with a second attempt using
npx create-expo-module@latestto no avail and tried to find out what’s causing this issue myself, but couldn’t really get far. Here’s what I’ve gathered at least:“Installing module dependencies” step executes
npm install, but it fails due to thepreparescript (expo-module prepare), which causes the entire install to crash down:Can anyone reproduce the following or is this a local issue?
Environment info:
Hey! Probably you are not using the latest version. I got the same issue on the older version. Please, try to run it like this:
npx create-expo-module@latest new-react-native-moduleSo seems like a backward compatibility issue to me.