Search code examples
angularjsjsontypescript-typingspackage.jsonlite-server

"npm start" local server is not working


I am trying Hello World in Angular 2 when I run "npm start" its not working. I have define start in script of package.json but start is not working

this is my package.json settings

{
  "name": "ng2-helloworld",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"",
    "test": "echo \"Error: no test specified\" && exit 1",
    "lite": "lite-server",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings",
    "postinstall": "typing install"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "concurrently": "^3.4.0",
    "lite-server": "^2.3.0",
    "typescript": "^2.2.2",
    "typings": "^2.1.1"
  }
}

this is my tsconfig.json setting

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "none",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noImplicitAny": false,
        "lib": ["es2015", "dom"]
    }
}

Solution

  • you have mistake you wrote none instead of node corrected code is below

    this is my package.json settings

    {
      "name": "ng2-helloworld",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"",
        "test": "echo \"Error: no test specified\" && exit 1",
        "lite": "lite-server",
        "tsc": "tsc",
        "tsc:w": "tsc -w",
        "typings": "typings",
        "postinstall": "typing install"
      },
      "keywords": [],
      "author": "",
      "license": "ISC",
      "devDependencies": {
        "concurrently": "^3.4.0",
        "lite-server": "^2.3.0",
        "typescript": "^2.2.2",
        "typings": "^2.1.1"
      }
    }
    

    this is my tsconfig.json setting

    {
        "compilerOptions": {
            "target": "es5",
            "module": "commonjs",
            "moduleResolution": "node",
            "sourceMap": true,
            "emitDecoratorMetadata": true,
            "experimentalDecorators": true,
            "removeComments": false,
            "noImplicitAny": false,
            "lib": ["es2015", "dom"]
        }
    }