Ionic: package.json missing start script - ionic-framework

My package.json doesn't have a start script, so npm start will not work.
My package.json looks like
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"build": "ionic-app-scripts build",
"watch": "ionic-app-scripts watch",
"serve:before": "watch",
"emulate:before": "build",
"deploy:before": "build",
"build:before": "build",
"run:before": "build"
},
"dependencies": {
"#angular/common": "2.2.1",
"#angular/compiler": "2.2.1",
"#angular/compiler-cli": "2.2.1",
"#angular/core": "2.2.1",
"#angular/forms": "2.2.1",
"#angular/http": "2.2.1",
"#angular/platform-browser": "2.2.1",
"#angular/platform-browser-dynamic": "2.2.1",
"#angular/platform-server": "2.2.1",
"#ionic/storage": "1.1.7",
"#agm/core": "1.0.0-beta.0",
"es6-promise": "3.0.2",
"es6-shim": "^0.35.0",
"ionic-angular": "2.0.0",
"ionic-native": "^2.2.14",
"ionicons": "3.0.0",
"ng2-cordova-oauth": "0.0.6",
"rxjs": "5.0.0-beta.12",
"sw-toolbox": "3.4.0",
"zone.js": "0.6.26"
},
"devDependencies": {
"#ionic/app-scripts": "1.0.0",
"typescript": "2.1.5"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard",
"cordova-plugin-inappbrowser"
],
"cordovaPlatforms": [
"ios",
{
"platform": "ios",
"version": "",
"locator": "ios"
}
],
"description": "third-party-auth-ionic2-tutorial: An Ionic project"
}
What should the start script contain?

From what I have found, Ionic projects do not use a start script in the package.json, so npm start is not needed.
use ionic start to create a new project and ionic serve to run the project during development as described in the Getting Started Guide.
There are other commands to build, deploy and package your project when needed, make sure to check the ionic documentation for how to do these the 'Ionic way'

Related

UNMET PEER DEPENDENCY error for ionic-paypal

I was trying to install paypal & onesignal plugin from official website with the help of official documentations and I got this error:
+-- UNMET PEER DEPENDENCY #ionic-native/core#4.3.2
`-- #ionic-native/paypal#5.30.0
Here is my Package.json
{
"name": "ionic-hello-world",
"version": "0.0.0",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "5.0.0",
"#angular/compiler": "5.0.0",
"#angular/compiler-cli": "5.0.0",
"#angular/core": "5.0.0",
"#angular/forms": "5.0.0",
"#angular/http": "5.0.0",
"#angular/platform-browser": "5.0.0",
"#angular/platform-browser-dynamic": "5.0.0",
"#ionic-native/core": "4.3.2",
"#ionic-native/onesignal": "^5.30.0",
"#ionic-native/paypal": "^5.30.0",
"#ionic-native/splash-screen": "4.3.2",
"#ionic-native/status-bar": "4.3.2",
"#ionic/storage": "2.1.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"woocommerce-api": "^1.5.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "^3.2.4",
"typescript": "2.4.2"
},
"cordovaPlugins": [
"ionic-plugin-keyboard",
"cordova-plugin-whitelist",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-splashscreen"
],
"cordovaPlatforms": [],
"description": "ClickThrough: An Ionic project"
}
The PayPal service used by ionic-native/paypal has been deprecated for years and is end of life on December 7.
You should instead integrate the v2/checkout/orders API from a server, with or without the JS front end for the approval flow.
Approval requires a full mobile browser or SFSafariViewController/Chrome Custom Tabs. Approval cannot be given in a WKWebView or similar.

Ionic 3 : npm install admob-free UNMEET PEER DEPENDENCIES

Ionic 3 : npm install admob-free UNMEET PEER DEPENDENCIES.
I cannot import the AdmobFree Library to the Ionic 3 project. It show error when i do npm install.
When I type :
npm install --save #ionic-native/admob-free
it show :
+-- #ionic-native/admob-free#4.5.2
`-- UNMET PEER DEPENDENCY #ionic-native/core#4.4.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN #ionic-native/admob#3.14.0 requires a peer of #ionic-native/core#^3.6.0 but none was installed.
for more detal, this is my package.json :
{
"name": "AcehTourismMap",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "5.0.3",
"#angular/compiler": "5.0.3",
"#angular/compiler-cli": "5.0.3",
"#angular/core": "5.0.3",
"#angular/forms": "5.0.3",
"#angular/http": "5.0.3",
"#angular/platform-browser": "5.0.3",
"#angular/platform-browser-dynamic": "5.0.3",
"#ionic-native/admob": "^3.14.0",
"#ionic-native/admob-free": "^4.5.2",
"#ionic-native/core": "^4.4.0",
"#ionic-native/launch-navigator": "^4.5.2",
"#ionic-native/splash-screen": "4.4.0",
"#ionic-native/status-bar": "^4.4.0",
"#ionic/storage": "2.1.3",
"cordova-admob-sdk": "^0.13.1",
"cordova-android": "~7.0.0",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-admob-free": "^0.13.0",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-dialogs": "^2.0.1",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.4.1",
"cordova-plugin-whitelist": "^1.3.1",
"cordova-promise-polyfill": "0.0.2",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^4.1.3",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "3.1.6",
"typescript": "2.4.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"ionic-plugin-keyboard": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-statusbar": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {},
"cordova-plugin-admob-free": {}
},
"platforms": [
"android"
]
}
}
How to fix this? The plugin/library not downloaded, and I cannot import the AdmobFree library
import { AdMobFree } from '#ionic-native/admob-free';
Thank you for the answer, I really appreciate, thank you......

node_modules/#angular/core/index"' has no exported member 'Version'

I am working on ionic/angular 2 and I just took the new clone of my project and ran npm install.Now when I run the ionic serve, it gives me the following error
typescript:/node_modules/#angular/forms/src/version.d.ts, line: 13
Module '/node_modules/#angular/core/index"' has no exported
member 'Version'.
Here is the ionic info
cli packages: (C:\Users\Admin\AppData\Roaming\npm\node_modules)
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 6.5.0
local packages:
#ionic/app-scripts : 1.3.12
Cordova Platforms : none
Ionic Framework : ionic-angular 2.0.0-rc.3
System:
Node : v6.9.1
npm : 3.10.8
OS : Windows 10
and here is my package.json
{
"name": "myApp",
"author": "Zohra",
"homepage": "https://www.example.com/",
"private": true,
"scripts": {
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/animations": "^4.2.6",
"#angular/common": "2.1.1",
"#angular/compiler": "2.1.1",
"#angular/compiler-cli": "2.1.1",
"#angular/core": "2.1.1",
"#angular/forms": "^2.1.1",
"#angular/http": "2.1.1",
"#angular/platform-browser": "2.1.1",
"#angular/platform-browser-dynamic": "2.1.1",
"#angular/platform-server": "2.1.1",
"#ionic-native/core": "^3.14.0",
"#ionic-native/splash-screen": "^3.10.3",
"#ionic-native/toast": "^3.14.0",
"#ionic/storage": "1.1.6",
"angular2-localstorage": "^0.4.0",
"angular2-moment": "^1.3.0",
"angularjs-toaster": "^2.1.0",
"chart.js": "^2.5.0",
"cordova-plugin-splashscreen": "~4.0.3",
"cordova-plugin-whitelist": "~1.3.2",
"gulp-browserify": "^0.5.1",
"intl": "^1.2.5",
"ionic-angular": "2.0.0-rc.3",
"ionic-native": "2.2.3",
"ionicons": "3.0.0",
"jquery": "^3.1.1",
"moment": "^2.17.1",
"ng2-webstorage": "^1.4.1",
"rxjs": "^5.0.1",
"zone.js": "0.6.26"
},
"devDependencies": {
"#ionic/app-scripts": "^1.2.2",
"#ionic/cli-plugin-cordova": "^1.0.0-rc.2",
"#ionic/cli-plugin-gulp": "1.0.2",
"#ionic/cli-plugin-ionic-angular": "1.3.2",
"typescript": "2.0.6"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard",
"de.appplant.cordova.plugin.local-notification",
"cordova-plugin-app-event"
],
"cordovaPlatforms": [
"android"
],
"description": "Ionic App",
"config": {
"ionic_source_map": "source-map"
},
"cordova": {
"plugins": {
"cordova-plugin-splashscreen": {},
"cordova-plugin-whitelist": {}
}
}
}
Please help me

Cannot find namespace 'moment'

I am using ionic 2.
I create new project
ionic start Ismart --v2
The project was successfully created.
I tried to run the project using ionic serve
I am getting this err
Cannot find namespace 'moment'
Here is my Package.Json
{
"name": "ionic-hello-world",
"version": "0.0.0",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "4.0.2",
"#angular/compiler": "4.0.2",
"#angular/compiler-cli": "4.0.2",
"#angular/core": "4.0.2",
"#angular/forms": "4.0.2",
"#angular/http": "4.0.2",
"#angular/platform-browser": "4.0.2",
"#angular/platform-browser-dynamic": "4.0.2",
"#ionic-native/core": "3.4.2",
"#ionic-native/splash-screen": "3.4.2",
"#ionic-native/status-bar": "3.4.2",
"#ionic/storage": "2.0.1",
"ionic-angular": "3.1.0",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"zone.js": "^0.8.5"
},
"devDependencies": {
"#ionic/app-scripts": "1.3.6",
"typescript": "~2.2.1"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "ISmartpremises: An Ionic project"
}
How can i fix this issue...
Kindly advice me,
Thanks
I cannot see any issue in your package.json file.I think you have forgotten to change the directory.
You can try as shown below.
d:\ionic2 > ionic start Ismart blank --v2
d:\ionic2\Ismart> ionic serve

Ionic 2 - watch failed: A watch configured to watch the following paths failed to start

I've been trying to get the Ionic watch to work, but I've been getting an error.
I created a brand new app with the following command:
ionic start my-app --v2
This seems to work fine, then I try to serve the app
ionic serve -p $PORT
However, I get the following error
watch failed: A watch configured to watch the following paths failed to start. It likely that a file
referenced does not exist: /home/ubuntu/workspace/my-app/src/**/*.(ts|html|s(c|a)ss)
I can see that the src folder does exist in the path shown in the error. Is there a way I can resolve this error? I'm using the C9 IDE and installed Ionic with the following command
sudo npm install ionic cordova -g
Here is my package.json in case it is needed:
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "2.4.8",
"#angular/compiler": "2.4.8",
"#angular/compiler-cli": "2.4.8",
"#angular/core": "2.4.8",
"#angular/forms": "2.4.8",
"#angular/http": "2.4.8",
"#angular/platform-browser": "2.4.8",
"#angular/platform-browser-dynamic": "2.4.8",
"#angular/platform-server": "2.4.8",
"#ionic-native/core": "3.1.0",
"#ionic-native/splash-screen": "3.1.0",
"#ionic-native/status-bar": "3.1.0",
"#ionic/storage": "2.0.0",
"ionic-angular": "2.2.0",
"ionicons": "3.0.0",
"rxjs": "5.0.1",
"sw-toolbox": "3.4.0",
"zone.js": "0.7.2"
},
"devDependencies": {
"#ionic/app-scripts": "1.1.4",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-statusbar",
"cordova-plugin-console",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"description": "my-app: An Ionic project"
}
I had the same error, I resolved it by deleting node_modules directory and run npm install