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)

Most upvoted comments

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-module on another environment with WSL2 and Yarn 1.22 it worked without any issue.

I downgraded Yarn to classic with yarn set version classic on my MacOS environment, re-ran the create-expo-module command and it went correctly through all the steps.

I can confirm, too, that using yarn v1 works. yarn set version classic will do the trick and then yarn create expo-module some-name

What 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 rsync wasn’t installed in my system

Using create-expo-module@latest didn’t work for me either

Went with a second attempt using npx create-expo-module@latest to 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 the prepare script (expo-module prepare), which causes the entire install to crash down:

❯ npm install

> new-expo-module@0.1.0 prepare
> expo-module prepare

Configuring module
Tried to guess the docs homepage for new-expo-module; add it under the "homepage" entry in package.json
expo-module-scripts: README.md exists, not updating
Internal Error: new-expo-module@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile

Can anyone reproduce the following or is this a local issue?

Environment info:

  expo-env-info 1.0.3 environment info:
    System:
      OS: macOS 13.0
      Shell: 3.5.1 - /opt/homebrew/bin/fish
    Binaries:
      Node: 18.10.0 - /opt/homebrew/bin/node
      Yarn: 3.2.0 - /opt/homebrew/bin/yarn
      npm: 9.2.0 - /opt/homebrew/bin/npm
    Managers:
      CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    IDEs:
      Android Studio: 2021.3 AI-213.7172.25.2113.9123335
      Xcode: 14.1/14B47b - /usr/bin/xcodebuild
    npmGlobalPackages:
      expo-cli: 6.0.8
    Expo Workflow: bare

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-module

So seems like a backward compatibility issue to me.