How to fix "ReferenceError: ionic not defined" when I run ionic serve --lab command

I created an ionic project in yeoman. I chose the localhost option when the ionic serve command showed multiple addresses. But when I run the application it shows an error in the console

   ReferenceError : ionic is not defined

      

And this is the complete process that I follow -

   Running live reload server: http://localhost:35729
   Watching : [ 'www/**/*', '!www/lib/**/*' ]
   Running dev server: http://localhost:8100
   Ionic server commands, enter:
   restart or r to restart the client app from the root
   goto or g and a url to have the app navigate to the given url
   consolelogs or c to enable/disable console log output
   serverlogs or s to enable/disable server log output
   quit or q to shutdown the server and exit

   ionic $ c
   Console log output: enabled
   Loading: /?restart=998712
   ionic $ 0     129599   error    ReferenceError: ionic is not defined,       http://localhost:8100/?ionicplatform=ios, Line: 103
    0     129653   error    ReferenceError: ionic is not defined,   http://localhost:8100/?ionicplatform=android, Line: 103

      

I can't figure out why this error is flashing on the console. Ionic is installed on my ionic system and I tested it using the ionic command. Here is a screenshot of the error I am getting. I also checked the ionic.config file on the system and its server address already exists as follows.

  "ionicServeAddress": "localhost"

      

Please help me to solve this problem.

+3


source to share


2 answers


I rebuilt the yomen project structure in admin mode and it worked.



-1


source


You solve your problems in two ways.



  • Removing node_modules and then running npm update
  • Reinstall gulp (but you have to install the global one)

    npm install -g gulp

0


source







All Articles