Ionic serve not working in Ionic 3

前端 未结 20 591
眼角桃花
眼角桃花 2021-01-16 23:06

My Ionic info:

cli packages: (/usr/lib/node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1 

local pack         


        
相关标签:
20条回答
  • 2021-01-16 23:38

    Please use these commands in your project.

    sudo sysctl fs.inotify.max_user_watches=524288
    
    sudo sysctl -p --system
    

    And again run ionic serve

    0 讨论(0)
  • 2021-01-16 23:40

    Install ws:

    npm install ws@3.3.2 --save-dev --save-exact
    
    0 讨论(0)
  • 2021-01-16 23:41

    Try npm run ionic:serve. Similar issue occurred when installing the latest cordova update.

    0 讨论(0)
  • 2021-01-16 23:41

    In ionic 3 you have to type:

    • cordova run android or cordova run ios, to deploy your build in device.

    • cordova build android or cordova build ios, for build only.

    0 讨论(0)
  • 2021-01-16 23:43

    My answers works. My machine is also having a different package of Node which I forgot about in the first place.

    So I've removed node_modules using:

    sudo rm -rf /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules
    sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node.1 /usr/local/lib/dtrace/node.
    

    To make things less complicated with all cli - head up back https://nodejs.org/ and install back the LTS package

    Uninstall Node from brew
    re-install node.js using conventional way using the installer

    0 讨论(0)
  • 2021-01-16 23:44

    Use these commands in your prompt.

    npm cache clear --force
    rm -rf node_modules/
    npm install -d
    
    0 讨论(0)
提交回复
热议问题