Getting Started
Create FiveM Resource is an unofficially supported way to create resource. It offers multiple options to create your resource like runtime and nui.
Quick Start
npx create-fivem-resource
If you've previously installed
create-fivem-resource
globally vianpm install -g create-fivem-resource
, we recommend you uninstall the package usingnpm uninstall -g create-fivem-resource
oryarn global remove create-fivem-resource
to ensure thatnpx
always uses the latest version.
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
Then upadate your server.cfg
to load my-res
at start
ensure my-res
Then start your FXServer, and connect to it using FiveM client
Get Started Immediately
You don’t need to install or configure tools like webpack or Babel. If needed configuration are already set in rollup.config.mjs
, tsconfig.json
and vite.json
so that you can focus on the code.
Create a resource, and you’re good to go.
Creating a resource
You’ll need to have Node >= 18. You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects. We recommend you to use the last LTS version
You’ll need to have Pnpm >= 9.5. You can install it following the instructions in pnpm docs.
To create a new app, you may choose one of the following methods:
npx
npx create-fivem-resource@latest
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
npm
npm init fivem-resource
npm init <initializer>
is available in npm 6+
Yarn
yarn create fivem-resource
yarn create
is available in Yarn 0.25+
Selecting a template
You can now fill the questions asked by CLI to selecte and configure you template with the diffrents options.
Exemples of options :
- Runtime => Javascript/Lua/Typescript
- Nui => React/Vue
Output
Running any of these commands will create a folder with the name of your resource. Inside that folder, it will generate the initial resource structure:
my-res
├── README_res.md
├── fxmanifest.lua
├── client
│ ├── ....
├── server
│ ├── ....
├── web
│ ├── ....
No configuration or complicated folder structures, only the files you need to build your resource. Once the installation is done, you can open your project folder:
cd my-res