Angular 2上Node的持续服务器问题

时间:2016-12-07 09:53:24

标签: node.js npm

我正在Pluralsight和其他网站上学习Angular 2,一切顺利,除了我每天都有问题" npm start"当我去一个项目工作时......这非常令人沮丧,我无法弄清楚它为什么会这样。我安装和卸载Node里面和外面谁知道多少次...昨天它正常工作,今天它再次给我这个错误 - 在Ubuntu 14.04几乎相同。和赢7:

有什么想法吗? :/

npm ERR! Linux 3.19.0-56-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.2.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! product-management@1.0.0 start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the product-management@1.0.0 start script 'tsc && concurrently "tsc -w" "lite-server" '.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the product-management package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc && concurrently "tsc -w" "lite-server" 
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs product-management
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls product-management
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/sm/Downloads/Pluralsight - Angular 2 Getting Started 2016-10-18/Angular2-GettingStarted-master/APM - Start/npm-debug.log

这是一个package.json文件:

{
    "name": "product-management",
    "version": "1.0.0",
    "author": "Deborah Kurata",
    "description": "Package for the Acme Product Management sample application",
    "scripts": {
        "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
        "tsc": "tsc",
        "tsc:w": "tsc -w",
        "lint": "tslint ./app/**/*.ts -t verbose",
        "lite": "lite-server",
        "typings": "typings",
        "postinstall": "typings install"
    },
    "license": "ISC",
        "dependencies": {
        "@angular/common": "2.0.0",
        "@angular/compiler": "2.0.0",
        "@angular/core": "2.0.0",
        "@angular/forms": "2.0.0",
        "@angular/http": "2.0.0",
        "@angular/platform-browser": "2.0.0",
        "@angular/platform-browser-dynamic": "2.0.0",
        "@angular/router": "3.0.0",

        "core-js": "^2.4.1",
        "reflect-metadata": "^0.1.3",
        "rxjs": "5.0.0-beta.12",
        "systemjs": "0.19.27",
        "zone.js": "^0.6.23",

        "bootstrap": "^3.3.6"
    },
    "devDependencies": {
        "concurrently": "^2.2.0",
        "lite-server": "^2.2.0",
        "tslint": "^3.7.4",
        "typescript": "^2.0.2",
        "typings": "^1.0.4"
    },
    "repository": {}
}

调试文件:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@3.10.10
3 info using node@v7.2.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle product-management@1.0.0~prestart: product-management@1.0.0
6 silly lifecycle product-management@1.0.0~prestart: no script for prestart, continuing
7 info lifecycle product-management@1.0.0~start: product-management@1.0.0
8 verbose lifecycle product-management@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle product-management@1.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/sm/Downloads/Pluralsight - Angular 2 Getting Started 2016-10-18/Angular2-GettingStarted-master/APM - Start/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/sm/.rvm/bin:/home/sm/.rvm/bin
10 verbose lifecycle product-management@1.0.0~start: CWD: /home/sm/Downloads/Pluralsight - Angular 2 Getting Started 2016-10-18/Angular2-GettingStarted-master/APM - Start
11 silly lifecycle product-management@1.0.0~start: Args: [ '-c', 'tsc && concurrently "npm run tsc:w" "npm run lite" ' ]
12 silly lifecycle product-management@1.0.0~start: Returned: code: 2  signal: null
13 info lifecycle product-management@1.0.0~start: Failed to exec start script
14 verbose stack Error: product-management@1.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
14 verbose stack Exit status 2
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:885:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid product-management@1.0.0
16 verbose cwd /home/sm/Downloads/Pluralsight - Angular 2 Getting Started 2016-10-18/Angular2-GettingStarted-master/APM - Start
17 error Linux 3.19.0-56-generic
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.2.1
20 error npm  v3.10.10
21 error code ELIFECYCLE
22 error product-management@1.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
22 error Exit status 2
23 error Failed at the product-management@1.0.0 start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the product-management package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     tsc && concurrently "npm run tsc:w" "npm run lite"
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs product-management
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls product-management
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

1 个答案:

答案 0 :(得分:0)

scripts.start文件中更改package.json后尝试检查:

"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",