[SOLVED] Problem to serve an app in ionic1 with installed Ionic CLI v3

Is there a bugs in latest v1 cli?
Just created a blank new v1 project and run ‘ionic serve’. It show me:

[INFO] Starting server: --port=8100 --p=8100 --livereload-port=35729 --r=35729 --address=0.0.0.0 - Ctrl+C to cancel
TypeError: Cannot read property ‘emit’ of undefined

Ionic info:
global packages:
ionic/cli-utils : 1.3.0
Ionic CLI : 3.3.0

local packages:
ionic/cli-plugin-ionic1 : 2.0.0
Ionic Framework : ionic1 1.3.3

System:
Node : v6.9.4
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.0
ios-sim : 5.0.11

i have a same problem… the ionic serve is running smoothly with previous ionic1 project, but it seems broken when i created new ionic start --type ionic1 apps (with any template: blank,sidemenu,etc). it just happen recently.

Edit:
i discover a temporary solution, please downgrade to cli version of 1.3.0, running this command: sudo npm install --save-dev --save-exact @ionic/cli-plugin-ionic1@1.3.0 @ionic/cli-plugin-cordova@latest

but i believe that this one is a bug from latest v1 CLI (2.0.0)

Im facing same problem.

People suggest downgrade

But I have apps that uses Ionic 1 and others using ionic 2

Downgrade is not the best solution for me.

Hey,

I had the same problem on multiple apps the simplest way to resolve this was to do exactly as the CLI suggested and to change my ionic.project file in the main directory to ionic.config.json.

This resolved the issue with minimal effort.

Hope this helps

2 Likes

Thanks! Works like a charm!

1 Like

i have a same problem. How to suggest,. I don’t understand:
1Go to the newly created project (with Ionic 3.1.1) and open package.json
2.There should be lines for the @ionic/cli-plugin …s
3.Copy these lines to package.json of your Ionic v1 project
4.Change the ionic-angular to ionic1 (this defines which plugin it installs - here you need a different one than in the new project)
5Run npm install in your v1 project folder
6Then try ionic serve and ionic info again.
Can you guide me?.

Thank you. It works for me

1 Like

Sounds like you may have just forgotten to navigate to your newly created folder …

Next Steps:

Hi.
How Can i compilar for Android my aplication?

hi, i had the same problem, and i already have ionic.config.json file but error still remains. please help.

Hi,
I have the same error as below while running ‘ionic serve’ in a V1 project.

[ERROR] Sorry! ionic serve can only be run in an Ionic project directory.
If this is a project you’d like to integrate with Ionic, create an ionic.config.json file.

I am not quite sure I have installed all the ionic setup thats required to run V1.

ionic info command results in below message;

[WARN] You are not in an Ionic project directory. Project context may be missing.
Ionic:
ionic (Ionic CLI) : 4.10.3
System:
NodeJS : v6.9.1
npm : 6.8.0
OS : Windows 10
Could you please help me out of this.
Thank you in advance

run cmd
:> npm install
:>ionic init
make name for the project then run
:>ionic serve
should work :wink: