Failing to ionic serve a new project (angular) from template ionic-cli@5.4.4

Hi there,

I’m not able to ionic serve a new fresh project generated with ionic cli 5.4.4.

Steps to reproduce:
ionic start blank-project blank --type=angular cd ./blank-project
$ ionic serve --verbose

Output:

aeris@aeris   ~/Proyectos/blank-project    master   ionic serve --verbose  :heavy_check_mark:  551  21:29:21 
ionic:lib Terminal info: { ci: false, shell: ‘/usr/bin/zsh’, tty: true, windows: false } +0ms
ionic:lib CLI global options: { _: [ ‘serve’ ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, ‘–’: } +3ms
ionic:lib:project Project type from config: @ionic/angular (angular) +0ms
ionic:lib:project Project details: { configPath: ‘/home/aeris/Proyectos/blank-project/ionic.config.json’, errors: , context: ‘app’, type: ‘angular’ } +0ms
ionic Context: { binPath: ‘/home/aeris/.npm-global/lib/node_modules/ionic/bin/ionic’, libPath: ‘/home/aeris/.npm-global/lib/node_modules/ionic’, execPath: ‘/home/aeris/Proyectos/blank-project’, version: ‘5.4.4’ } +0ms
ionic:lib:serve serve options: { ‘–’: ,
ionic:lib:serve address: ‘localhost’,
ionic:lib:serve browser: undefined,
ionic:lib:serve browserOption: undefined,
ionic:lib:serve devapp: false,
ionic:lib:serve engine: ‘browser’,
ionic:lib:serve externalAddressRequired: false,
ionic:lib:serve lab: false,
ionic:lib:serve labHost: ‘localhost’,
ionic:lib:serve labPort: 8200,
ionic:lib:serve livereload: true,
ionic:lib:serve open: true,
ionic:lib:serve platform: undefined,
ionic:lib:serve port: 8100,
ionic:lib:serve proxy: true,
ionic:lib:serve project: undefined,
ionic:lib:serve verbose: true,
ionic:lib:serve consolelogs: undefined,
ionic:lib:serve consolelogsPort: undefined,
ionic:lib:serve ssl: undefined,
ionic:lib:serve configuration: undefined,
ionic:lib:serve sourcemaps: undefined } +0ms
ionic:lib:telemetry Sending telemetry for command: ‘ionic serve’ [ ‘–verbose’, ‘–interactive’, ‘–color’ ] +0ms
ionic:lib:hooks Looking for ionic:serve:before npm script. +0ms
ionic:utils-network checking for open port on 0.0.0.0:8100 +0ms
ionic:utils-network checking for open port on 127.0.0.1:8100 +4ms
ionic:utils-network checking for open port on ::1:8100 +1ms
ionic:utils-network checking for open port on 192.168.1.145:8100 +0ms
ionic:utils-network checking for open port on fe80::468a:5bff:fe45:7720:8100 +1ms
ionic:utils-network error while checking fe80::468a:5bff:fe45:7720:8100: { Error: listen EINVAL: invalid argument fe80::468a:5bff:fe45:7720:8100 at Server.setupListenHandle [as _listen2] (net.js:1262:19) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) code: ‘EINVAL’, errno: ‘EINVAL’, syscall: ‘listen’, address: ‘fe80::468a:5bff:fe45:7720’, port: 8100 } +0ms
ionic:utils-network checking for open port on 172.17.0.1:8100 +0ms
ionic:utils-network checking for open port on fe80::42:69ff:fe91:ce99:8100 +1ms
ionic:utils-network error while checking fe80::42:69ff:fe91:ce99:8100: { Error: listen EINVAL: invalid argument fe80::42:69ff:fe91:ce99:8100 at Server.setupListenHandle [as _listen2] (net.js:1262:19) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) code: ‘EINVAL’, errno: ‘EINVAL’, syscall: ‘listen’, address: ‘fe80::42:69ff:fe91:ce99’, port: 8100 } +0ms
ionic:utils-network checking for open port on 172.18.0.1:8100 +0ms
ionic:utils-network checking for open port on fe80::42:74ff:fe89:ea34:8100 +0ms
ionic:utils-network error while checking fe80::42:74ff:fe89:ea34:8100: { Error: listen EINVAL: invalid argument fe80::42:74ff:fe89:ea34:8100 at Server.setupListenHandle [as _listen2] (net.js:1262:19) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) code: ‘EINVAL’, errno: ‘EINVAL’, syscall: ‘listen’, address: ‘fe80::42:74ff:fe89:ea34’, port: 8100 } +0ms
ionic:utils-network checking for open port on fe80::501e:54ff:fe26:c069:8100 +0ms
ionic:utils-network error while checking fe80::501e:54ff:fe26:c069:8100: { Error: listen EINVAL: invalid argument fe80::501e:54ff:fe26:c069:8100 at Server.setupListenHandle [as _listen2] (net.js:1262:19) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) code: ‘EINVAL’, errno: ‘EINVAL’, syscall: ‘listen’, address: ‘fe80::501e:54ff:fe26:c069’, port: 8100 } +2ms
ionic:utils-network checking for open port on fe80::d079:afff:fea2:d3b6:8100 +0ms
ionic:utils-network error while checking fe80::d079:afff:fea2:d3b6:8100: { Error: listen EINVAL: invalid argument fe80::d079:afff:fea2:d3b6:8100 at Server.setupListenHandle [as _listen2] (net.js:1262:19) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) code: ‘EINVAL’, errno: ‘EINVAL’, syscall: ‘listen’, address: ‘fe80::d079:afff:fea2:d3b6’, port: 8100 } +0ms
ionic:utils-network checking for open port on fe80::842f:60ff:fe6a:4291:8100 +1ms
ionic:utils-network error while checking fe80::842f:60ff:fe6a:4291:8100: { Error: listen EINVAL: invalid argument fe80::842f:60ff:fe6a:4291:8100 at Server.setupListenHandle [as _listen2] (net.js:1262:19) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) code: ‘EINVAL’, errno: ‘EINVAL’, syscall: ‘listen’, address: ‘fe80::842f:60ff:fe6a:4291’, port: 8100 } +0ms
ionic:utils-network checking for open port on fe80::884a:a8ff:fe21:8fc9:8100 +0ms
ionic:utils-network error while checking fe80::884a:a8ff:fe21:8fc9:8100: { Error: listen EINVAL: invalid argument fe80::884a:a8ff:fe21:8fc9:8100 at Server.setupListenHandle [as _listen2] (net.js:1262:19) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) code: ‘EINVAL’, errno: ‘EINVAL’, syscall: ‘listen’, address: ‘fe80::884a:a8ff:fe21:8fc9’, port: 8100 } +0ms
ionic:utils-network checking for open port on fe80::e0a4:7fff:fe97:3670:8100 +0ms
ionic:utils-network error while checking fe80::e0a4:7fff:fe97:3670:8100: { Error: listen EINVAL: invalid argument fe80::e0a4:7fff:fe97:3670:8100 at Server.setupListenHandle [as _listen2] (net.js:1262:19) at listenInCluster (net.js:1327:12) at doListen (net.js:1460:7) at process._tickCallback (internal/process/next_tick.js:63:19) code: ‘EINVAL’, errno: ‘EINVAL’, syscall: ‘listen’, address: ‘fe80::e0a4:7fff:fe97:3670’, port: 8100 } +0ms
ionic:lib:serve Looking for ionic:serve npm script. +17ms

ng run app:serve --host=localhost --port=8100 --verbose
ionic:lib:serve received unexpected close for ng (code: 127) +853ms

[ERROR] ng has unexpectedly closed (exit code 127).

    The Ionic CLI will exit. Please check any output above for error details.

ionic:utils-process onBeforeExit handler: ‘process.exit’ received +0ms
ionic:utils-process onBeforeExit handler: running 1 functions +1ms
ionic:utils-process processExit: exiting (exit code: 1) +12ms

environment:

It’s kind of weird that the npm version is not recognised by ionic info, but it’s installed and in PATH.

Any help would be very thanked!

I have the exact same issue, but with the blank react template on a completely fresh Ubuntu 18.04. Doesn’t work on both latest Node10 and Node12. Any help is much appreciated - I can’t even execute line 1 of the tutorial :frowning:

It also seems to crash on IPv6 like address.

Ionic:

   Ionic CLI       : 5.4.13 (/usr/local/lib/node_modules/ionic)
   Ionic Framework : @ionic/react 4.11.7

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v12.14.1 (/snap/node/2585/bin/node)
   npm    : not installed
   OS     : Linux 5.0

If anyone else has this - for some reason ionic doesn’t like npm being installed from snap. Installing from PPA works.

Fixed – not an ionic issue.

nvm is an even better option, because you never have to run anything as root.