Ricerca nel sito web

Come installare Ionic Framework su Debian 10


Su questa pagina

  1. Prerequisiti
  2. Per iniziare
  3. Installa Node.js
  4. Installa Ionic Framework
  5. Crea un progetto con Ionic
  6. Avvia l'applicazione
  7. Conclusione

Ionic è un framework gratuito e open source per la creazione di app native e web multipiattaforma di alta qualità. Viene fornito con una potente interfaccia a riga di comando che ti aiuta a creare un progetto da un semplice comando. Ionic supporta Android, IOS e la piattaforma Windows universale per lo sviluppo di app. Ionic utilizza i plug-in Cardova per accedere a fotocamera, GPS e torcia.

In questo post, ti mostreremo come installare Ionic Mobile App Framework sul server Debian 10.

Prerequisiti

  • Un server che esegue Debian 10.
  • Sul server è configurata una password di root.

Iniziare

Innanzitutto, aggiorna i pacchetti di sistema alla versione aggiornata eseguendo il seguente comando:

apt-get update -y

Una volta aggiornati tutti i pacchetti, puoi installare altri pacchetti richiesti con il seguente comando.

apt-get install curl gnupg2 wget -y

Installa Node.js

Successivamente, dovrai installare Node.js sul tuo sistema. Per impostazione predefinita, l'ultima versione di Node.js non è inclusa nel repository Debian. Quindi dovrai aggiungere il repository di origine del nodo al tuo sistema.

Puoi aggiungere il repository di origine del nodo con il seguente comando:

curl -sL https://deb.nodesource.com/setup_14.x | bash -

Una volta aggiunto il repository, installa Node.js con il seguente comando:

apt-get install nodejs -y

Dopo aver installato Node.js, verifica la versione di Node.js con il seguente comando:

node --version

Dovresti vedere il seguente output:

v14.17.1

Successivamente, devi anche installare Cordova sul tuo sistema. Puoi installarlo con il seguente comando:

npm install -g cordova

Una volta installato, puoi procedere al passaggio successivo.

Installa Ionic Framework

Innanzitutto, dovrai installare un'utilità CLI ionic sul tuo server. Puoi installarlo con il seguente comando:

npm i -g @ionic/cli

Dopo aver installato ionic, verifica la versione ionic con il seguente comando:

ionic -v

Dovresti ottenere il seguente output:

6.16.3

Crea un progetto con Ionic

Ora puoi creare il tuo primo progetto con il seguente comando:

ionic start

Ti verrà chiesto di selezionare il framework tra React o Angular, specificare il nome del progetto e selezionare un modello come mostrato di seguito:

Pick a framework! ????

Please select the JavaScript framework to use for your new app. To bypass this prompt next time, supply a value for the
--type option.

? Framework: Angular

Every great app needs a name! ????

Please enter the full name of your app. You can change this at any time. To bypass this prompt next time, supply name,
the first argument to ionic start.

? Project name: myapp

Let's pick the perfect starter template! ????

Starter templates are ready-to-go Ionic apps that come packed with everything you need to build your app. To bypass this
prompt next time, supply template, the second argument to ionic start.

? Starter template: tabs
? Preparing directory ./myapp in 3.69ms
? Downloading and extracting tabs starter in 591.18ms
? Integrate your new app with Capacitor to target native iOS and Android? No

Your Ionic app is ready! Follow these next steps:

- Go to your new project: cd ./myapp
- Run ionic serve within the app directory to see your app in the browser
- Run ionic capacitor add to add a native iOS or Android project using Capacitor
- Generate your app icon and splash screens using cordova-res --skip-config --copy
- Explore the Ionic docs for components, tutorials, and more: https://ion.link/docs
- Building an enterprise app? Ionic has Enterprise Support and Features: https://ion.link/enterprise-edition

Avviare l'applicazione

Ora, cambia la directory nel tuo progetto e avvia l'applicazione con il seguente comando:

cd myapp
ionic serve --host 0.0.0.0 --port 8100,/p>

Dovresti ottenere il seguente output:

> ng run app:serve --host=0.0.0.0 --port=8100
[INFO] Development server running!
       
       Local: http://localhost:8100
       External: http://216.98.11.73:8100
       
       Use Ctrl+C to quit this process

[INFO] Browser window opened to http://localhost:8100!

Ora, apri il tuo browser web e accedi alla tua applicazione utilizzando l'URL http://your-server-ip:8100. Dovresti vedere la tua applicazione ionica nella seguente schermata:

Conclusione

Congratulazioni! hai installato con successo il framework Ionic sul server Debian 10. Ora puoi iniziare a creare la tua applicazione mobile utilizzando il framework Ionic.