Ionic-cli: ionic 2 after create app then serve get this error

Created on 22 Nov 2016  路  8Comments  路  Source: ionic-team/ionic-cli

Hi,
In windows 8 , installed ionic@latest and gone through of project creation and then run command "ionic serve" and got below error every second until ctrl + c;

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

[15:32:30] transpile started ...
Caught exception:
TypeError: undefined is not a function
at Socket. (C:UsersroshanAppDataRoamingnpmnode_modulesioni
clibutilsnpmScripts.js:39:49)
at Socket.emit (events.js:129:20)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at Pipe.onread (net.js:538:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

[15:32:41] build dev failed: undefined is not a function
[15:32:41] dev server running: http://localhost:8100/
Caught exception:
TypeError: undefined is not a function
at Socket. (C:UsersroshanAppDataRoamingnpmnode_modulesioni
clibutilsnpmScripts.js:39:49)
at Socket.emit (events.js:129:20)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at Pipe.onread (net.js:538:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

Caught exception:
TypeError: undefined is not a function
at Socket. (C:UsersroshanAppDataRoamingnpmnode_modulesioni
clibutilsnpmScripts.js:39:49)
at Socket.emit (events.js:129:20)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at Pipe.onread (net.js:538:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

[15:32:41] copy finished in 11.69 s
Caught exception:
TypeError: undefined is not a function
at Socket. (C:UsersroshanAppDataRoamingnpmnode_modulesioni
clibutilsnpmScripts.js:39:49)
at Socket.emit (events.js:129:20)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at Pipe.onread (net.js:538:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues


Please let us know the solution get on nest level.

Thanks

old major version

Most helpful comment

The following resolved this issue for me:

  1. Uninstalled and installed latest NodeJS
  2. Ran "npm update -g"
  3. Ran "npm rebuild node-sass"
  4. "ionic serve" ran successfully after this

All 8 comments

I'm getting the exact same error on Mac OSX:

```Caught exception:
TypeError: undefined is not a function
at Socket. (/usr/local/lib/node_modules/ionic/lib/utils/npmScripts.js:39:49)
at Socket.emit (events.js:129:20)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at Pipe.onread (net.js:538:20)

Mind letting us know? https://github.com/driftyco/ionic-cli/issues```

Same issue when trying to build a new project

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.14
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.45
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 8.1
Node Version: v0.12.2
Xcode version: Not installed

The following resolved this issue for me:

  1. Uninstalled and installed latest NodeJS
  2. Ran "npm update -g"
  3. Ran "npm rebuild node-sass"
  4. "ionic serve" ran successfully after this

This worked for me as well.

Same error here. The @emersonstewart solution, not working form me

I get the same error with Ionic 2, too. @emersonstewart solution did not solve for me. Ionic1 project works fine, though.

My system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.14
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.45
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 8.1
Node Version: v0.12.2
Xcode version: Not installed

Any help, please? Thank you.

@emersonstewart solution did not work for me either. I was simply trying to "ionic serve" the "MyIonic2Project" from the ionic tutorial at "http://ionicframework.com/docs/v2/intro/tutorial/". My details as below:
Win 8.1
Node v0.12.2
NPM v2.7.4
Ionic v2.2.1
Cordova v6.5.0

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings