`rnv new` fails with exit code 1 on yarn add
Describe the bug
rnv new command doesn't work.
It fails with the following error Error: Command failed with exit code 1: yarn add @rnv/[email protected] --dev
To Reproduce Steps to reproduce the behavior:
- Run command 'rnv new'
- See error
(.venv) ➜ testRNV rnv new
┌─────────────────────────────────────────────────────────────────┐
│ ██████╗ ███████╗███╗ ██╗ █████╗ ████████╗██╗██╗ ██╗███████╗ │
│ ██╔══██╗██╔════╝████╗ ██║██╔══██╗╚══██╔══╝██║██║ ██║██╔════╝ │
│ ██████╔╝█████╗ ██╔██╗ ██║███████║ ██║ ██║██║ ██║█████╗ │
│ ██╔══██╗██╔══╝ ██║╚██╗██║██╔══██║ ██║ ██║╚██╗ ██╔╝██╔══╝ │
│ ██║ ██║███████╗██║ ╚████║██║ ██║ ██║ ██║ ╚████╔╝ ███████╗ │
│ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚══════╝ │
│ 🚀 v:1.0.0-rc.18 | renative.org | 03/05/2024, 16:21:33 │
│ $ rnv new │
└─────────────────────────────────────────────────────────────────┘
info: Current engine: @rnv/engine-core (/usr/local/lib/node_modules/rnv/node_modules/@rnv/engine-core/lib)
task: ○ new ↺1
? What's your project Name? (folder will be created) hello-renative
warn: Folder ./hello-renative already exists. RNV will override it.
? Continue? Yes
info: Cleaning up existing folder...
warn: You are in ReNative project. Found: ./hello-renative/renative.json
? Are you sure you want to continue? Yes
? What workspace to use? rnv
? What template to use? @rnv/template-starter - Multiplatform 'hello world' template
✔ Executing: npm view @rnv/template-starter versions
✔ Executing: npm dist-tag ls @rnv/template-starter
? What @rnv/template-starter version to use? 1.0.0-rc.18 (@next)
✖ FAILED: yarn add @rnv/[email protected] --dev
error: ⨯ COMMAND:
yarn add @rnv/[email protected] --dev
FAILED with ERROR:
Error: Command failed with exit code 1: yarn add @rnv/[email protected] --dev
at makeError (/usr/local/lib/node_modules/rnv/node_modules/execa/lib/error.js:60:11)
at handlePromise (/usr/local/lib/node_modules/rnv/node_modules/execa/index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
┌─────────────────────────────────────────────────────────────────┐
│ ⨯ SUMMARY | 03/05/2024, 16:21:50 | [email protected] │
│ $ rnv new │
├─────────────────────────────────────────────────────────────────┤
│ Engine: @rnv/engine-core │
│ Build Scheme (-s): debug │
│ Env Info: linux | x64 | node v18.20.2 │
│ Executed Time: 0h:0m:16s:772ms │
│ warn: Folder ./hello-renative already exists. RNV will override it.
│ warn: You are in ReNative project. Found: ./hello-renative/renative.json
│ error: ⨯ COMMAND:
yarn add @rnv/[email protected] --dev
FAILED with ERROR:
Error: Command failed with exit code 1: yarn add @rnv/[email protected] --dev
at makeError (/usr/local/lib/node_modules/rnv/node_modules/execa/lib/error.js:60:11)
at handlePromise (/usr/local/lib/node_modules/rnv/node_modules/execa/index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
└─────────────────────────────────────────────────────────────────┘
Expected behavior A new project creation
Desktop:
- OS: Ubuntu 22.04.4 LTS
- Node Version: v18.20.2
- RNV Version: npm install [email protected]
Facing Similar issue on my macOs Ventura. it was working perfectly previously
@paulNIP could you provide a proper error message? Is it exactly the same? Also your rnv, os, node versions?
@TSienki thanks for reporting this issue. I'm getting the same error on Ubuntu 20.04.5, Node v.18.20.2, RNV 1.0.0-rc.18
NOTE: if I used Node v.18.19.0 -> no error, project created successfully ->
~/Desktop/qa$ rnv new
┌─────────────────────────────────────────────────────────────────┐
│ ██████╗ ███████╗███╗ ██╗ █████╗ ████████╗██╗██╗ ██╗███████╗ │
│ ██╔══██╗██╔════╝████╗ ██║██╔══██╗╚══██╔══╝██║██║ ██║██╔════╝ │
│ ██████╔╝█████╗ ██╔██╗ ██║███████║ ██║ ██║██║ ██║█████╗ │
│ ██╔══██╗██╔══╝ ██║╚██╗██║██╔══██║ ██║ ██║╚██╗ ██╔╝██╔══╝ │
│ ██║ ██║███████╗██║ ╚████║██║ ██║ ██║ ██║ ╚████╔╝ ███████╗ │
│ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚══════╝ │
│ 🚀 v:1.0.0-rc.18 | [renative.org](http://renative.org/) | 5/10/2024, 1:20:40 PM │
│ $ rnv new │
└─────────────────────────────────────────────────────────────────┘
info: Current engine: @rnv/engine-core (../../.nvm/versions/node/v18.19.0/lib/node_modules/rnv/node_modules/@rnv/engine-core/lib)
task: ○ new ↺1
? What's your project Name? (folder will be created) hello-renative
? What workspace to use? rnv
? What template to use? @rnv/template-starter - Multiplatform 'hello world' template
✔ Executing: npm view @rnv/template-starter versions
✔ Executing: npm dist-tag ls @rnv/template-starter
? What @rnv/template-starter version to use? 1.0.0-rc.18 (@next)
✔ Executing: yarn add @rnv/[email protected] --dev
✔ Executing: yarn add @rnv/[email protected] --dev
? How to create config renative.json? Extend template (cleaner, overridable)
? What's your project Title? My Renative App
? What's your App ID? com.mycompany.hellorenative
? What's your project version? 0.1.0
? What platforms would you like to use? web, ios, android
? Do you want to set-up git in your new project? Yes
info: Your project does not have a git repo. Creating one...DONE
✔ Executing: git init
info: Missing directory ./hello-renative/buildHooks.js. COPYING from TEMPATE...DONE
info: Missing directory ./hello-renative/src/app.js. COPYING from TEMPATE...DONE
info: Missing directory ./hello-renative/src/entry.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/src/config.tsx.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/index.js.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/tsconfig.json.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/babel.config.js.js. COPYING from TEMPATE...DONE
info: Missing directory ./hello-renative/typings.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/.gitignore.js. COPYING from TEMPATE...DONE
info: Missing directory ./hello-renative/appConfigs/app.js. COPYING from TEMPATE...DONE
info: Missing directory ./hello-renative/appConfigs/base/assets.js. COPYING from TEMPATE...DONE
info: Missing directory ./hello-renative/appConfigs/base/fonts.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/Gemfile.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/metro.config.js.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/react-native.config.js.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/next.config.js.js. COPYING from TEMPATE...DONE
info: Missing file ./hello-renative/next-env.d.ts.js. COPYING from TEMPATE...DONE
info: Missing directory ./hello-renative/src/pages.js. COPYING from TEMPATE...DONE
info: .rnv folder missing. CREATING...DONE
info: .rnv/schemas folder missing. CREATING...DONE
info: Updating appConfig app with title: My Renative App and id: com.mycompany.hellorenative
? Project is ready. Do you want to install all dependencies now? Yes
✔ Executing: yarn
task: ✔ new
┌─────────────────────────────────────────────────────────────────┐
│ ✔ SUMMARY | 5/10/2024, 1:22:32 PM | [email protected] │
│ $ rnv new │
├─────────────────────────────────────────────────────────────────┤
│ Project: [email protected] │
│ Workspace: rnv │
│ Engine: @rnv/engine-core │
│ Template: @rnv/template-starter │
│ Build Scheme (-s): debug │
│ Env Info: linux | x64 | node v18.19.0 │
│ Executed Time: 0h:1m:51s:343ms │
│
Generated Project Summary:
-------------------------
Project Name (--projectName): hello-renative
Package name: hello-renative
Project Version (--appVersion): 0.1.0
Workspace (--workspace): rnv
App Title (--title): My Renative App
App ID (--id): com.mycompany.hellorenative
Project Template (--template): @rnv/[email protected]
Git Enabled (--gitEnabled): true
Enabled Platforms: web, ios, android
-------------------------
✔ Your project is ready! Run it with:
cd hello-renative
npx rnv run
│ You are trying to run global rnv command in your current project.
│ This might lead to unexpected behaviour.
│ Run your rnv command with npx prefix:
│ npx rnv new
└─────────────────────────────────────────────────────────────────┘
@TSienki try to install yarn (npm i yarn -g), it should fix this issue
Closing as answer has been provided, feel free to reopen if needed