Installation
Get MoroJS up and running in your development environment. Follow the steps below to install and configure the framework.
Prerequisites
Before installing MoroJS, ensure you have the following:
- Node.js 18.0.0 or higher
- npm, yarn, or pnpm package manager
- TypeScript knowledge (recommended)
Installation
1Install MoroJS
Install MoroJS using your preferred package manager:
npm
typescript
yarn
typescript
pnpm
typescript
2Create Your Project
Set up a new project with TypeScript configuration:
Project Setup
typescript
3Configure Scripts
Add the following scripts to your package.json:
package.json
json
Verify Installation
Create a simple test file to verify that MoroJS is working correctly:
src/server.ts
typescript
Run the server
typescript
Success!
If everything is working correctly, you should see the server start message and be able to visithttp://localhost:3000
to see your API response.
TypeScript Configuration
For optimal TypeScript support, ensure your tsconfig.json includes these settings:
tsconfig.json
json
Troubleshooting
Common Issues
Node.js version issues
Ensure you're using Node.js 18 or higher. You can check your version with node --version
.
TypeScript compilation errors
Make sure your tsconfig.json has "moduleResolution": "NodeNext"
and "esModuleInterop": true
.
Import/export issues
Use ES modules syntax: import { createApp } from '@morojs/moro'
instead of CommonJS require.