Skip to content

ionic serve should not need internet connection #2397

@dmastag

Description

@dmastag

Short description of the problem:

I tried running ionic serve while I was offline and got this message

ionic serve
[ERROR] An error occurred while running npm view ionic dist-tags.latest --json (exit code 1):

        npm ERR! code ENOTFOUND
        npm ERR! errno ENOTFOUND
        npm ERR! syscall getaddrinfo
        npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
        npm ERR! network This is a problem related to network connectivity.
        npm ERR! network In most cases you are behind a proxy or have bad network settings.
        npm ERR! network
        npm ERR! network If you are behind a proxy, please make sure that the
        npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
        {
          "error": {
            "code": "ENOTFOUND",
            "summary": "getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443",
            "detail": "This is a problem related to network connectivity.\nIn most cases you are behind a proxy or have bad network settings.\n\nIf you are behind a proxy, please make sure that the\n'proxy' config is set properly.  See: 'npm help config'"
          }
        }

        npm ERR! A complete log of this run can be found in:
        npm ERR!     C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2017-06-06T03_14_01_930Z-debug.log

What behavior are you expecting?

We should still be able to use ionic serve even when we are offline

Steps to reproduce:

  1. Disconnect from the Internet
  2. run ionic serve
insert any relevant code between the above and below backticks

Post the output of ionic info below please

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

ionic info

global packages:

    @ionic/cli-utils : 1.3.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.3.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.3.0
    @ionic/cli-plugin-ionic-angular : 1.3.0
    Cordova Platforms               : android 6.2.3 ios 4.3.1
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v8.0.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions