Npm start 在 Angular 2 和 Laravel 5 项目中不起作用

Npm start doesn't work in an Angular 2 and Laravel 5 project

我正在做一个 Laravel 5.2 和 Angular 2 项目,我刚刚完成 angular 的设置,但是 运行 npm start,我出现以下错误:

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! @ postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ postinstall script 'typings install'.
npm ERR! This is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

你们能帮帮我吗?

这是我的内容 package.json :

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch",
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "laravel-elixir": "^5.0.0",
    "bootstrap-sass": "^3.0.0",
    "concurrently": "^1.0.0",
    "del": "^2.2.0"
  },
  "dependencies": {
    "angular2": "2.0.0-beta.0",
    "bootstrap-sass": "^3.0.0",
    "elixir-typescript": "^1.1.2",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "laravel-elixir": "^4.0.0",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.0",
    "systemjs": "0.19.6",
    "zone.js": "0.5.10"
  }
}

我也遇到这个问题,我按照以下步骤操作

 1. i uninstall nodejs and install the latest version.
 2. close the command promt and open.
 3. execute npm install
 4. execute npm build(not nesessery) 
 5. execute npm start

这对我有用。

您的脚本在尝试 运行 'typings install' 时失败。
1. 在 devDependencies

中包含类型
{
  "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.2.0",
    "typescript": "^1.8.10",
    "typings": "^1.0.4"
  }
}
  1. 运行 npm 安装

  2. 如下创建typings.json

    {
      "globalDependencies": {
        "core-js": "registry:dt/core-js#0.0.0+20160602141332",
        "jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
        "node": "registry:dt/node#6.0.0+20160807145350"
      }
    }
    
  3. npm 启动

    if you still having issue install typings globally npm install typings --global