2015-07-10 39 views
3

我已经在yeoman创建了一个离子项目。当ionic serve命令显示多个地址时,我选择了localhost选项。但是,当我运行的应用程序的显示错误控制台如何解决“参考错误:离子未定义”当我运行命令离子服务--lab

ReferenceError : ionic is not defined 

上,并且这是我下面的完整过程 -

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 

我无法理解,为什么这个错误是在闪烁安慰。 Ionic安装在我的系统离子上,我已经使用离子命令测试了它。这是我得到的错误的截图。我还检查了ionic.config文件系统和它的服务器地址已经存在以下方式

"ionicServeAddress": "localhost" 

请帮我解决这个问题。

+0

你有在你的ionic.project文件中定义的gulp任务吗? – cfprabhu

+0

任何解决方案呢? –

回答

-1

我重新创建自耕农项目结构在管理员模式下,它的工作。

0

你必须解决两个方面的问题的。

  1. 删除node_modules,然后运行NPM更新
  2. 重新安装一饮而尽(但你应该安装全球)

    NPM安装-g一饮而尽

+1

它没有这样工作。 –

+0

我已经尝试了几次,它没有工作! –

相关问题