ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Ignite project creation is broken on Windows

Open AsterisMono opened this issue 1 year ago • 1 comments
trafficstars

Describe the bug

✅ What bundle identifier? · com.pizzaappnpx
✅ Where do you want to start your project? · C:\Users\cmiki\Documents\Projects\PizzaAppNpx
✅ How do you want to manage Native code? · CNG
✅ Do you want to initialize a git repository? (Y/n) · Yes
✅ Remove demo code? We recommend leaving it in if it's your first time using Ignite (y/N) · No
✅ Which package manager do you want to use? · pnpm
✅ Do you want to install dependencies? (Y/n) · No
✅ [Experimental] Expo Router for navigation? (y/N) · No
✅ [Experimental] the New Architecture? (y/N) · No

<Ignite ASCII art>

    █ Creating PizzaAppNpx using Ignite 10.0.1
    █ Powered by  ∞ Infinite Red  (https://infinite.red)
    █ Package Manager: pnpm
    █ Bundle identifier: com.pizzaappnpx
    █ Path: C:\Users\cmiki\Documents\Projects\PizzaAppNpx
    ────────────────────────────────────────────────────

    🖨   3D-printing a new React Native app
    🎨 Getting those last few details perfect
    ⚙️ Configuring app.json
    🛠️  Removing fancy demo markup

The following error occurred:

    Error: Command failed: rm -rf src
'rm' is not recognized as an internal or external command,
operable program or batch file.


    Consider opening an issue with the following information at:
    https://github.com/infinitered/ignite/issues/new?template=bug_report.yml&labels=bug

Node uses CMD to execute system.run commands on Windows, but rm and mv are not available in CMD.

I've come up with a PR to resolve this issue -- see below.

Ignite version

10.0.1

Additional info

System
  platform           win32
  arch               x64
  cpu                16 cores     11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
  directory          Projects     C:\Users\cmiki\Documents\Projects

JavaScript
  node               20.11.1                                   C:\Program Files\nodejs\node.EXE
  npm                10.2.4                                    C:\Program Files\nodejs\npm.CMD
  yarn               1.22.21                                   C:\Program Files\nodejs\yarn.CMD
  pnpm               8.15.3                                    C:\Program Files\nodejs\pnpm.CMD
                     <no pnpm global package info available>
  bun                -                                         not installed
  expo               -                                         not installed

Ignite
  ignite-cli         10.0.1       C:\Users\cmiki\AppData\Local\npm-cache\_npx\e31027f3785124a8\node_modules\.bin\ignite.CMD
  ignite src         build        C:\Users\cmiki\AppData\Local\npm-cache\_npx\e31027f3785124a8\node_modules\ignite-cli\build

Android
  java               17.0.12      C:\Program Files\Eclipse Adoptium\jre-17.0.12.7-hotspot\bin\java.EXE
  android home       -            undefined

Tools
  git                git version 2.43.0.windows.1   C:\Program Files\Git\cmd\git.EXE

AsterisMono avatar Oct 19 '24 10:10 AsterisMono

run npm install [email protected]^ and try again. The latest version must be broken.

marcoperic avatar Oct 20 '24 01:10 marcoperic

@AsterisMono curious what shell do you run in and what Windows version?

I can't reproduce the error in PowerShell or cmd on Windows 10

frankcalise avatar Oct 29 '24 18:10 frankcalise

Thanks for this contribution!

The default Ignite new path works on Windows:

npx ignite-cli new PizzaApp \
        --bundle=com.pizzaapp \
        --git \
        --install-deps=false \
        --packager=npm \
        --target-path=C:\Users\joshu\Code\PizzaApp \
        --remove-demo=false \
        --workflow=CNG \
        --no-timeout=false \
        --state=mst

But I'm having some issues with the Expo Router workflow.

npx ignite-cli new ExpoRouterApp \
        --bundle=com.exporouterapp \
        --git \
        --install-deps=false \
        --packager=npm \
        --target-path=C:\Users\joshu\Code\ExpoRouterApp \
        --remove-demo=false \
        --experimental=expo-router \
        --workflow=CNG \
        --no-timeout=false \
        --state=mst

When I try to run any expo commands, I get

CommandError: Cannot find module 'ajv/dist/compile/codegen'
Require stack:
- C:\Users\joshu\Code\ExpoRouterApp\node_modules\ajv-keywords\dist\definitions\typeof.js

and the clean up commands seem not to be working, this file should be removed

image

joshuayoes avatar Oct 29 '24 19:10 joshuayoes

:tada: This issue has been resolved in version 10.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

infinitered-circleci avatar Oct 29 '24 22:10 infinitered-circleci