ionic serve bug with #ionic/cli-plugin-ionic-angular in ionic3 - ionic-framework

I just ran into this bug while trying to run my ionic3 app in my browser. I have recently migrated from ionic2 to ionic3 and it was quite smooth. After a few runs, this bug came up.
C:\Users\Emeka\Documents\Current Project\Freelance>ionic serve
[ERROR] An error occurred while running npm view #ionic/cli-plugin-ionic-angular dist-tags.latest --json (exit code 1):
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall getaddrinfo
npm ERR! enoent getaddrinfo ENOENT registry.npmjs.org:443
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
{
"error": {
"code": "ENOENT",
"summary": "getaddrinfo ENOENT registry.npmjs.org:443",
"detail": "This is related to npm not being able to find a file.\n"
}
}
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Emeka\AppData\Roaming\npm-cache\_logs\2017-06-09T21_18_38_802Z-debug.log

Did u try deleting ur node-modules directory and running npm install again?

I just solved the problem after looking up a link -- https://www.npmjs.com/package/#ionic/app-scripts
First I ran npm install #ionic/app-scripts#latest --save-dev
C:\Users\Emeka\Documents\Current Project\Freelance>npm install #ionic/app-scripts#latest --save-dev
npm WARN deprecated object-keys#0.2.0: Please update to the latest object-keys
+ #ionic/app-scripts#1.3.7
added 63 packages, removed 9 packages and updated 1 package in 118.187s
Then considering the warning I had to update my object-keys to the latest version
C:\Users\Emeka\Documents\Current Project\Freelance>npm install object-keys#latest --save-dev
+ object-keys#1.0.11
updated 1 package in 30.535s
Finally I tried my ionic serve again and it was fine without errors
C:\Users\Emeka\Documents\Current Project\Freelance>ionic serve
[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to cancel
[23:13:09] watch started ...
[23:13:09] build dev started ...
[23:13:09] clean started ...
[23:13:10] clean finished in 104 ms
[23:13:10] copy started ...
[23:13:10] transpile started ...
[23:13:23] transpile finished in 13.17 s
[23:13:23] preprocess started ...
[23:13:23] deeplinks started ...
[23:13:23] deeplinks finished in 169 ms
[23:13:23] preprocess finished in 185 ms
[23:13:23] webpack started ...
[23:13:25] copy finished in 15.44 s
[23:13:39] webpack finished in 16.25 s
[23:13:39] sass started ...
[23:13:49] sass finished in 10.25 s
[23:13:49] postprocess started ...
[23:13:50] postprocess finished in 70 ms
[23:13:50] lint started ...
[23:13:50] build dev finished in 40.20 s
[23:13:50] watch ready in 40.95 s
[23:13:50] dev server running: http://localhost:8100/

Related

parcel build error: "extendDefaultPlugins"

i'm trying to build project of mine.
I new to using parcel. To build process i have this command line
"build": "parcel build index.html --dist-dir ./dist"
I get this error.
console:
"extendDefaultPlugins" utility is deprecated.
Use "preset-default" plugin with overrides instead.
For example:
{
name: 'preset-default',
params: {
overrides: {
// customize plugin options
convertShapeToPath: {
convertArcs: true
},
// disable plugins
convertPathData: false
}
}
}
√ Built in 4.24s
dist\index.html 3.74 KB 879ms
dist\favicon.9a1bb8f5.png 13.3 KB 24ms
dist\logo.9272a069.png 92.31 KB 49ms
dist\icons.9801e6f1.svg 8.81 KB 871ms
dist\index.20fbdb0c.css 9.96 KB 2.00s
dist\index.4a83a35e.js 125.64 KB 1.68s
dist\icons.9801e6f1.svg 8.81 KB 871ms
[Error: Error opening directory]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! forkify#1.0.0 build: `parcel build index.html --dist-dir ./dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the forkify#1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
I can't find a solution.
Please help me.
This was an issue in parcel 2.0.0-rc.0, that is fixed in the now-released version 2.0.0.
It had no functional impact - it was just a warning that the way in which the #parcel/optimizer-htmlnano configured svgo should eventually be updated to use a new technique.

ionic 2/3 build fail

I need help, I can not build my app, I get the following error:
[19:09:38] typescript: src/pages/sidemenu/sidemenu.ts, line: 24
[19:09:38] typescript: src/pages/sidemenu/sidemenu.ts, line: 25
[19:09:38] ionic-app-script task: "build"
[19:09:38] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError (/usr/src/app/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at /usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:137:20
at Promise ()
at transpileWorker (/usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:103:12)
at Object.transpile (/usr/src/app/node_modules/#ionic/app-scripts/dist/transpile.js:61:12)
at buildProject (/usr/src/app/node_modules/#ionic/app-scripts/dist/build.js:97:78)
at /usr/src/app/node_modules/#ionic/app-scripts/dist/build.js:47:16
at
npm info lifecycle payman#0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! payman#0.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the payman#0.0.1 build script.
This is probably not a problem with npm. There is likely additional logging output above.
can anybody help me please??
Happens most of the time because of the version of #ionic/app-scripts try to remove the package and add it again using npm

Issus Ionic Cordova platform add IOS

ionic Cordova platform and IOS
✖ Cordova platform adds ios --save - failed!
[ERROR] Exception: Using Cordova-fetch for Cordova-ios#^4.4.0
Error: Failed to fetch platform `cordova-ios#^4.4.0`
Probably this is either a connection problem or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 254 Error output:
npm ERR! path
/Users/zion/Desktop/RSSFeederApp/node_modules/node_modules/file:cordova-dist-dev/CB-11690/cordova-common-1.4.1.tgz
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall stat
npm ERR! enoent ENOENT: no such file or directory, stat
'/Users/zion/Desktop/RSSFeederApp/node_modules/node_modules/file:cordova-dist-dev/CB-11690/cordova-common-1.4.1.tgz'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zion/.npm/_logs/2017-08-31T07_48_01_154Z-debug.log
This issue is related to npm 5.3.0.
It is best to downgrade to 5.2.0 using npm install -g npm#5.2.0
For us this is most commonly caused by npm's broken lockfile approach.
To resolve it, delete the package-lock.json and run your command again.
try this, and make sure you are using Mac
ionic platform add ios

Serve error with ionic conference app

Trying to get ionic conference app (https://github.com/driftyco/ionic-conference-app) working.
ionic 2.1.13
npm version: 3.10.8
node version: 6.9.1
cordova version: 6.4.0
ionic serve -l results in the following output:
ionic-conference-app# ionic:serve C:\data\app\mkb
ionic-app-scripts serve "-l"
[13:21:16] ionic-app-scripts 0.0.44
[13:21:16] watch started ...
[13:21:16] build dev started ...
[13:21:16] clean started ...
[13:21:16] clean finished in less than 1 ms
[13:21:16] copy started ...
[13:21:16] transpile started ...
events.js:160
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 0.0.0.0:8100
at Object.exports._errnoException (util.js:1026:11)
at exports._exceptionWithHostPort (util.js:1049:20)
at Server._listen2 (net.js:1257:14)
at listen (net.js:1293:10)
at net.js:1403:9
at _combinedTickCallback (internal/process/next_tick.js:77:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program >
Files\nodejs\node_modules\npm\bin\npm-cli.js" "r
" "ionic:serve" "--" "-l"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! ionic-conference-app# ionic:serve: ionic-app-scripts serve "-l"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-conference-app# ionic:serve script 'ionic-app-
scripts serve "-l"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-conference-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts serve "-l"
npm ERR! You can get information on how to open an issue for this project with:
...
There was an error serving your Ionic application: There was an error with the spawned command: serve
Any ideas as to what has gone wrong?
Many thanks
I've just tried it and it was working for me. On the package.json, it's showing that it's using the latest rc3 ("ionic-angular": "2.0.0-rc.3-201611211919") so try to do the following:
Update your ionic CLI: npm install -g ionic
Delete your node folder and do again npm install
Now, what do you get with ionic serve ?
the error you get is
listen EADDRINUSE 0.0.0.0:8100
looks like the port 8100 is in use.
try running on a different port using
--port=8101
also you can change this value in the run.js file
The error suggests to me that the port is in use already.
In my case I closed my browser instances connected to my Ionic app and also closed down my other VS Code Ionic projects and tried running the ionic serve command again and this appeared to resolve the problem.

build prod failed: spawn EACCES with ionic2

I build an hybrid app using Ionic 2.
I got a windows pc and using mac virtual box for Xcode.
I can run the app on browser and android just fine in my windows.
problem is when I'm moving to mac I'm doing the same things on node JS and I get errors.
I used those lines in the terminal
ionic start/run/emulate/build Vme2
sudo ionic start/run/emulate/build Vme2
none works
this is the error I get
> ionic-hello-world# build /Users/amitaimazliah/Desktop/Vme2
> ionic-app-scripts build
[08:38:07] ionic-app-scripts 0.0.38
[08:38:07] build prod started ...
[08:38:07] clean started ...
[08:38:07] clean finished in 3 ms
[08:38:07] copy started ...
[08:38:07] ngc started ...
[08:38:07] copy finished in 262 ms
[08:38:07] build prod failed: spawn EACCES
[08:38:07] ionic-app-script task: "build"
[08:38:07] Error: spawn EACCES
npm ERR! Darwin 14.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world# build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world# build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/amitaimazliah/Desktop/Vme2/npm-debug.log
Caught exception:
undefined
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
[08:38:07] lint started ...
[08:38:08] tslint: src/pages/home/home.ts, line: 57
Unused method: 'setNewPhotos'
L57: private setNewPhotos()
[08:38:08] lint finished in 1.27 s
(node:2376) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed
any ideas what am I doing wrong?
thanks
You have problem when build app.Can you try use this command '
ionic hooks add
Cheer !