Ionic2 serve not working - node.js

When i write ionic serve nothing opens. I have tried changing nodejs versions. Reinstalling ionic cordova. Also cleared cache and other ways on internet. Nothing works. Please help. No errors are shown but a window is not opened.
Info:
C:\Projects\cutePuppyPics>ionic info
cli packages: (C:\Users\Tullo\AppData\Roaming\npm\node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 3.1.4
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.1
npm : 5.5.1
OS : Windows 10
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Serve:
C:\Projects\cutePuppyPics>ionic serve
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser -
Ctrl+C to cancel
[20:52:58] watch started ...
[20:52:58] build dev started ...
[20:52:58] clean started ...
[20:52:58] clean finished in 12 ms
[20:52:58] copy started ...
[20:52:58] deeplinks started ...
[20:52:58] deeplinks finished in 40 ms
[20:52:58] transpile started ...
[20:53:03] transpile finished in 5.17 s
[20:53:03] preprocess started ...
[20:53:04] preprocess finished in 4 ms
[20:53:04] webpack started ...
[20:53:04] copy finished in 5.44 s
[20:53:13] webpack finished in 9.14 s
[20:53:13] sass started ...
[20:53:14] sass finished in 1.68 s
[20:53:14] postprocess started ...
[20:53:14] postprocess finished in 16 ms
[20:53:14] lint started ...
[20:53:14] build dev finished in 16.32 s
[20:53:14] watch ready in 16.47 s`enter code here`
[20:53:14] dev server running: http://localhost:8100/
[OK] Development server running!
Local: http://localhost:8100
External: http://192.168.10.8:8100
DevApp: cutePuppyPics#8100 on LAPTOP-NNU75MUT

Sometimes the browser doesn't open automatically. Try entering http://localhost:8100 on your browser manually after ionic serve.

force an ip adresse
ionic serve --address YOUR_IP_ADDRESS
your ip adresse should be available , i think you can use 192.168.10.8 or 127.0.0.1

Related

Waiting for connectivity with react-scripts on ionic serve

I have an Ionic project, which works fine on my windows machine and friend's mac, but I got a problem on linux.
The problem appears on ionic serve, it's infinitely Waiting for connectivity with react-scripts..., and appearing continues while it's running. Development server seems to work fine.
Hope, we'll find a solution.
CLI output:
npm run start
> [project name]#0.0.1 start
> ionic serve
> react-scripts start
[react-scripts] ℹ 「wds」: Project is running at http://192.168.1.66/
[react-scripts] ℹ 「wds」: webpack output is served from
[react-scripts] ℹ 「wds」: Content not from webpack is served from /[project path]/app/public
[react-scripts] ℹ 「wds」: 404s will fallback to /
[react-scripts] Starting the development server...
[react-scripts]
[react-scripts] You can now view better-call in the browser.
[react-scripts] Local: http://localhost:8100
[react-scripts] On Your Network: http://192.168.1.66:8100
[react-scripts] Note that the development build is not optimized.
[react-scripts] To create a production build, use npm run build.
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
I have same issue, because I used node 18, with 16 it's better.
You can resolve it with this:
Install npm i n.
Install older version of node, 16 works fine for me, then install it with this command -> n 16.
Change version of node that you want, just put n in your terminal, and then select the 16 node version, and use ionic serve again
I hope this works for you.
Best

gulp trust-dev-cert without error, but access the page still failed

After I upgrade my Nodejs to v9.3.0 and NPM to 5.5.1, failed to access the gulp serve server. The browser show the unsafe TLS security error.
I have removed ~.gcb-serve-data/, and run the gulp trust-dev-cert without error, but I cannot find the cert in my trust certificates, I am working in Win10.
Following is the **gulp trust-dev-cert" output:
[18:30:14] Starting gulp
[18:30:14] Starting 'trust-dev-cert'...
[18:30:14] Starting subtask 'configure-sp-build-rig'...
[18:30:14] Finished subtask 'configure-sp-build-rig' after 7.48 ms
[18:30:14] Starting subtask 'trust-cert'...
[18:30:14] Finished subtask 'trust-cert' after 79 ms
[18:30:14] Finished 'trust-dev-cert' after 90 ms
[18:30:14] ==================[ Finished ]==================
gulp trust-dev-cert must be executed IN the project folder.

Grunt error when running Sails.js app in Amazon ElasticBeanstalk

I am moving a Sails.js app hosted on Heroku to Amazon ElasticBeanstalk. When the application launches, it throws the following Grunt error (pulled from eb logs):
info: Sails <| .-..-.
info: v0.11.5 |\
info: /|.\
info: / || \
info: ,' |' \
info: .-'.-==|/_--'
info: `--'-------'
info: __---___--___---___--___---___--___
info: ____---___--___---___--___---___--___-__
info:
info: Server lifted in `/var/app/current`
info: To see your app, visit http://localhost:8081
info: To shut down Sails, press <CTRL> + C at any time.
debug: --------------------------------------------------------
debug: :: Mon Feb 29 2016 08:21:46 GMT+0000 (UTC)
debug: Environment : development
debug: Port : 8081
debug: --------------------------------------------------------
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
>> FileError: '../bower_components/bootstrap/less/grid.less' wasn't found in assets/styles/importer.less on line 9, column 1:
>> 8 // Import Bootstrap
>> 9 #import "../bower_components/bootstrap/less/grid.less";
>> 10 #import "../bower_components/bootstrap/less/mixins.less";
Warning: Error compiling assets/styles/importer.less
Aborted due to warnings.
Running "less:dev" (less) task
------------------------------------------------------------------------
error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `/var/app/current/.tmp` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R 497 /var/app/current/.tmp
The same code runs fine on my local development laptop and on Heroku but not on ElasticBeanstalk. Why is it unable to find the bootstrap files? This being a PaaS, I can't even run the recommended sudo chown command that the log recommended. Also to be clear, I have the following command in my package.json file:
"scripts": {
"postinstall": "bower install; grunt build",
"debug": "node debug app.js",
"start": "node app.js"
}
I have instructed the script to run bower install after the NPM packages are installed in the machine. None of the images in my /assets folder seem to load either. Not sure what's going on. Please help.

Webstorm cannot recognize node Express both on Windows and Ubuntu

environment:
Webstorm v10.0.4
Node.js v0.12.5
Windows 8.1
Ubuntu 14.04
Just as the image showing below, on the pannel of creating 'Node.js Express App', Webstorm only finds Node and npm, but can not recognize Express.
Of course Express is installed globally, and I can create a Express project via express-generator on terminal.
➜ ~ npm -g list -depth=0
/usr/local/lib
├── bower#1.4.1
├── cheerio#0.19.0
├── express#4.13.0
├── express-generator#4.12.4
├── npm#2.11.2
└── nrm#0.2.5
And the idea.log as follow, not detail messages:
[ 0] INFO - #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------
[ 93] INFO - #com.intellij.idea.Main - IDE: WebStorm (build #WS-141.1550, 12 Jun 2015 00:00)
[ 93] INFO - #com.intellij.idea.Main - OS: Windows 8 (6.2, x86)
[ 93] INFO - #com.intellij.idea.Main - JRE: 1.8.0_40-b26 (Oracle Corporation)
[ 93] INFO - #com.intellij.idea.Main - JVM: 25.40-b25 (Java HotSpot(TM) Server VM)
[ 109] INFO - #com.intellij.idea.Main - JVM Args: -Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=150m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djb.vmOptions=D:\WebStorm 10.0.4\bin\WebStorm.exe.vmoptions -Xbootclasspath/a:D:\WebStorm 10.0.4\lib\boot.jar -Didea.platform.prefix=WebStorm -Didea.no.jre.check=true -Didea.paths.selector=WebStorm10
[ 281] INFO - #com.intellij.idea.Main - JNA library loaded (32-bit) in 172 ms
[ 296] INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational
[ 328] INFO - #com.intellij.idea.Main - Using "FocusKiller" library to prevent focus stealing.
[ 1920] INFO - llij.ide.plugins.PluginManager - Cannot find optional descriptor js-nashorn-support.xml
[ 3094] INFO - llij.ide.plugins.PluginManager - 48 plugins initialized in 1909 ms
[ 3110] INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: ASP (0.1), AngularJS (141.1550), CSS Support, CVS Integration (11), CoffeeScript (2.0), Cucumber.js (141.1550), Dart (141.1550), EJS (141.1550), EditorConfig (1.0), File Watchers (141.1550), Gherkin (999.999), Git Integration (8.1), GitHub, HAML, HTML Tools (2.0), Handlebars/Mustache (141.1550), IDEA CORE, IntelliLang (8.0), JSTestDriver Plugin (141.1550), Jade (141.1550), Java Server Pages Integration (1.0), JavaScript Debugger (1.0), JavaScript Intention Power Pack (0.9.4), JavaScript Support (1.0), Karma (141.1550), LESS support, LiveEdit (999.0), Meteor (141.1550), NodeJS (141.1550), Perforce Integration (2.0), PhoneGap/Cordova Plugin (141.1550), Polymer & Web Components (141.1550), QuirksMode, REST Client, Refactor-X (2.01), Remote Hosts Access (0.1), SASS support, Spy-js (141.1550), Stylus support (141.1550), Subversion Integration (1.1), Task Management (1.0), Terminal (0.1), TextMate bundles support (VERSION), W3C Validators (2.0), XPathView + XSLT Support (4), XSLT-Debugger (1.4), YAML, hg4idea (10.0)
[ 4391] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=200; buffer=10; max=498008064
[ 4469] INFO - api.vfs.impl.local.FileWatcher - Starting file watcher: D:\WebStorm 10.0.4\bin\fsnotifier.exe
[ 4516] INFO - api.vfs.impl.local.FileWatcher - Native file watcher is operational.
[ 5474] INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: []
[ 6709] INFO - rains.ide.BuiltInServerManager - built-in server started, port 63343
[ 8931] INFO - pl.stores.ApplicationStoreImpl - 77 application components initialized in 5758 ms
[ 8965] INFO - .intellij.idea.IdeaApplication - App initialization took 10956 ms
[ 9614] INFO - ellij.project.impl.ProjectImpl - 16 project components initialized in 258 ms
[ 9614] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
[ 17941] INFO - odejs.packages.NodePackageUtil - Loading node package info for express-generator ...
[ 20427] INFO - odejs.packages.NodePackageUtil - Info for express-generator node package loaded successfully in 2478.9 ms
[ 21655] INFO - odejs.packages.NodePackageUtil - Loading node package info for express-generator ...
[ 22243] INFO - odejs.packages.NodePackageUtil - Info for express-generator node package loaded successfully in 577.0 ms
This problem is occured both on Ubuntu and Windows.
Your help is appreciated!
Updated:
Just as shown below, I use nrm to select the fastest npm mirror -- taobao, and Webstorm goes wrong with it. When changed back to npm' main repository,Webstormcan fetchexpress-generator` info, and everything is OK. Strange!
C:\Users\honghe>nrm ls
npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
* taobao - http://registry.npm.taobao.org/
edunpm - http://registry.enpmjs.org/
eu ----- http://registry.npmjs.eu/
au ----- http://registry.npmjs.org.au/
sl ----- http://npm.strongloop.com/
nj ----- https://registry.nodejitsu.com/
pt ----- http://registry.npmjs.pt/
C:\Users\honghe>nrm test
npm ---- 1646ms
cnpm --- 1275ms
* taobao - 4388ms
edunpm - 994ms
eu ----- 2422ms
au ----- 1040ms
sl ----- 1369ms
nj ----- 2176ms
pt ----- Fetch Error
Initially, WebStorm installs specified version of express-generator package in temporary directory. Then WebStorm uses it to generate a new Express project. WebStorm doesn't use already installed express or express-generator packages.
BTW, express-generator always installs express package locally to a new project, so already installed express packages cannot be reused anyway.
According to the screenshot, the problem is that Version: Unavailable (version of express-generator). The cause should be specified at the bottom of the dialog, below CSS combobox. Not sure, but probably, it might be caused by the lack of the Internet connection. More detailed error description can be found in idea.log (on the main menu "Help | Show Log in Explorer").
I stumbled on this question while looking for a resolution. Mine was a syntax error in the 'package.json' file. Either in the main project directory or the node install within Program Files. The IDE doesn't flag the error, it just states that its 'Unavailible'.
To resolve this do the following, open CMD - within the folder for the node instalation, Delete the package.json along with the node_modules folder. (Ensure the non default ones are backed up so you can get them back) Then run:
npm init
This will intialise npm and restore the default packages and package.json. This will in turn restore express-generator.

Karma can't capture PhantomJS

We've set up a Jenkins CI server running Karma targeting PhantomJS. We're running our tests through Grunt. Jenkins, Grunt, and Phantom are all running correctly, and Karma seems to start up fine, but Karma can't capture Phantom. Our scripts run locally (OSX) just fine. The same error exists running via bash or through Jenkins:
Running "karma:jenkins-unit" (karma) task
[2013-07-03 11:03:12.168] [WARN] config - urlRoot normalized to "/__karma/"
DEBUG [reporter]: Using reporter "dots".
DEBUG [reporter]: Using reporter "junit".
DEBUG [reporter]: Using reporter "coverage".
INFO [karma]: Karma server started at http://localhost:8084/__karma/
INFO [launcher]: Starting browser PhantomJS
DEBUG [launcher]: Creating temp dir at /tmp/testacular-7720703
DEBUG [launcher]: phantomjs /tmp/testacular-7720703/capture.js
INFO [karma]: To run via this server, use "karma run --runner-port 9104"
...
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 0
DEBUG [launcher]: Cleaning temp dir /tmp/testacular-7720703
INFO [launcher]: Trying to start PhantomJS again.
DEBUG [launcher]: Creating temp dir at /tmp/testacular-7720703
DEBUG [launcher]: phantomjs /tmp/testacular-7720703/capture.js
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 0
DEBUG [launcher]: Cleaning temp dir /tmp/testacular-7720703
INFO [launcher]: Trying to start PhantomJS again.
DEBUG [launcher]: Creating temp dir at /tmp/testacular-7720703
DEBUG [launcher]: phantomjs /tmp/testacular-7720703/capture.js
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS exitted with code 0
DEBUG [karma]: PhantomJS failed to capture, aborting the run.
DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Killing PhantomJS
DEBUG [launcher]: Cleaning temp dir /tmp/testacular-7720703
Warning: Task "karma:jenkins-unit" failed. Use --force to continue.
Our server is CentOS 6.4.
Here are the versions we have running:
grunt-cli v0.1.9
grunt v0.4.1
node 0.10.12 and 0.8.25.
phantomjs 1.9.1
karma 0.8.6
Any help would be much appreciated!
Use polling instead of sockets and absolute paths instead of relative paths in the karma.conf.js configuration file to ensure the directory structure is being traversed correctly and the client/server connection has no external dependencies:
module.exports = function(config)
{
var absolute_root = process.cwd() + '/';
config.set
(
{
// https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files
files:
[
absolute_root + 'test/Spec/**/*.js',
absolute_root + 'js/*.js',
absolute_root + '../libs/jquery.js'
],
usePolling: true,
transports: ['xhr-polling', 'jsonp-polling'],
browsers: ['PhantomJS']
}
);
};
References
Karma is not able to run test cases on phantomJS
Karma doesn't exit properly when using public api with the finish callback
AngularJS + Socket.IO + karma not working in karma 0.8.5
Karma Runner Hangs Indefinitely
Preprocessors not running in Jenkins(Linux)
"basePath" is relative to "C:\" instead of config file
Karma config.js
Istanbul/coverage reporter generate LCOV file with relative path for SF parameter instead of absolute path
In my case adding
transports: ['xhr-polling', 'jsonp-polling']
to karma.conf.js was sufficient. The real problem was a very old version of karma (0.12). Now with 1.4. I don't need CPU consuming polling.

Resources