2016-07-29 169 views
0

我在克隆一個已經存在的項目。當我建,我得到這個錯誤保存在npm-debug.lognpm ERR! jspm軟件包

0 info it worked if it ends with ok 
1 verbose cli [ 'c:\\Program Files\\nodejs\\node.exe', 
1 verbose cli 'c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 
1 verbose cli 'run', 
1 verbose cli 'bundle-dep' ] 
2 info using [email protected] 
3 info using [email protected] 
4 verbose run-script [ 'prebundle-dep', 'bundle-dep', 'postbundle-dep' ] 
5 info prebundle-dep [email protected] 
6 info bundle-dep [email protected] 
7 verbose unsafe-perm in lifecycle true 
8 info [email protected] Failed to exec bundle-dep script 
9 verbose stack Error: [email protected] bundle-dep: `jspm bundle "src - [src/**/*] - [components/**/*]" www/bundle.js` 
9 verbose stack Exit status 1 
9 verbose stack  at EventEmitter.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16) 
9 verbose stack  at EventEmitter.emit (events.js:110:17) 
9 verbose stack  at ChildProcess.<anonymous> (c:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14) 
9 verbose stack  at ChildProcess.emit (events.js:110:17) 
9 verbose stack  at maybeClose (child_process.js:1015:16) 
9 verbose stack  at Process.ChildProcess._handle.onexit (child_process.js:1087:5) 
10 verbose pkgid [email protected] 
11 verbose cwd c:\GIT\mas\Rapid\hide 
12 error Windows_NT 6.1.7601 
13 error argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "bundle-dep" 
14 error node v0.12.4 
15 error npm v2.10.1 
16 error code ELIFECYCLE 
17 error [email protected] bundle-dep: `jspm bundle "src - [src/**/*] - [components/**/*]" www/bundle.js` 
17 error Exit status 1 
18 error Failed at the [email protected] bundle-dep script 'jspm bundle "src - [src/**/*] - [components/**/*]" www/bundle.js'. 
18 error This is most likely a problem with the sdk package, 
18 error not with npm itself. 
18 error Tell the author that this fails on your system: 
18 error  jspm bundle "src - [src/**/*] - [components/**/*]" www/bundle.js 
18 error You can get their info via: 
18 error  npm owner ls sdk 
18 error There is likely additional logging output above. 
19 verbose exit [ 1, true ] 

雖然這裏的package.json

{ 
    "name": "sdk", 
    "version": "1.0.0", 
    "description": "", 
    "main": "index.js", 
    "scripts": { 
    "postinstall": "typings install && bower install --production && jspm install && node src/tools/updateDependencies.js && npm run bundle-dep", 
    "_jspm": "jspm install", 
    "_postjspm": "node src/tools/updateDependencies.js && npm run bundle-dep", 
    "bundle-dep": "jspm bundle \"src - [src/**/*] - [components/**/*]\" www/bundle.js", 
    "start": "node dev-server.js" 
    }, 
    "author": "", 
    "license": "ISC", 
    "dependencies": { 
    "jspm": "^0.17.0-beta.12", 
    "typings": "^0.7.12" 
    }, 
    "devDependencies": { 
    "angular2": "2.0.0-beta.15", 
    "chokidar-socket-emitter": "^0.3.1", 
    "express": "^4.13.4", 
    "open": "0.0.5", 
    "rxjs": "5.0.0-beta.2", 
    "spdy": "^3.2.3" 
    }, 
    "jspm": { 
    "name": "sdk", 
    "directories": { 
     "lib": "src" 
    }, 
    "dependencies": { 
     "angular2": "npm:[email protected]", 
     "es6-shim": "github:es-shims/[email protected]^0.35.0", 
     "json": "github:systemjs/[email protected]^0.1.0", 
     "systemjs-hot-reloader": "github:capaj/[email protected]^0.5.6" 
    }, 
    "devDependencies": { 
     "os": "github:jspm/[email protected]^0.2.0-alpha", 
     "plugin-typescript": "github:frankwallis/[email protected]^4.0.5" 
    }, 
    "peerDependencies": { 
     "assert": "github:jspm/[email protected]^0.2.0-alpha", 
     "fs": "github:jspm/[email protected]^0.2.0-alpha", 
     "net": "github:jspm/[email protected]^0.2.0-alpha", 
     "process": "github:jspm/[email protected]^0.2.0-alpha", 
     "reflect-metadata": "npm:[email protected]", 
     "rxjs": "npm:[email protected]^5.0.0-beta.2", 
     "tty": "github:jspm/[email protected]^0.2.0-alpha", 
     "util": "github:jspm/[email protected]^0.2.0-alpha", 
     "zone.js": "npm:[email protected]^0.6.6" 
    }, 
    "overrides": { 
     "npm:[email protected]": { 
     "main": false, 
     "dependencies": { 
      "reflect-metadata": "npm:[email protected]", 
      "rxjs": "npm:[email protected]^5.0.0-beta.2", 
      "zone.js": "npm:[email protected]^0.6.6" 
     }, 
     "peerDependencies": { 
      "reflect-metadata": "npm:[email protected]", 
      "rxjs": "npm:[email protected]^5.0.0-beta.2", 
      "zone.js": "npm:[email protected]^0.6.6" 
     }, 
     "jspmNodeConversion": false, 
     "map": { 
      "crypto": "@empty" 
     }, 
     "meta": { 
      "src/*.js": { 
      "deps": [ 
       "reflect-metadata", 
       "zone.js" 
      ] 
      } 
     }, 
     "format": "detect" 
     }, 
     "npm:[email protected]": { 
     "main": "browser.js", 
     "jspmNodeConversion": false, 
     "format": "cjs", 
     "map": { 
      "./browser.js": { 
      "node": "./node.js" 
      }, 
      "fs": "@node/fs", 
      "net": "@node/net", 
      "tty": "@node/tty", 
      "util": "@node/util" 
     } 
     }, 
     "npm:[email protected]": { 
     "jspmNodeConversion": false, 
     "format": "cjs" 
     }, 
     "npm:[email protected]": { 
     "map": { 
      "crypto": "@empty" 
     } 
     }, 
     "npm:[email protected]": { 
     "browser": {}, 
     "map": { 
      "buffer": "@empty", 
      "child_process": "@empty", 
      "fs": "@empty", 
      "path": "@empty", 
      "process": "@empty", 
      "readline": "@empty" 
     } 
     } 
    } 
    } 
} 

看來這個問題是scriptsbundle-dep。出了什麼問題?

回答

0

錯誤是由作爲安裝的一部分觸發的腳本引起的。

這是的package.json:

"scripts": { 
    "postinstall": ... && jspm install ..." 

它看起來像這樣包要求你有jspm已經在全球安裝。

如果您信任this package,則可以運行npm install -g jspm並重試。

更多文檔here

+0

也這麼想,所以我在全球範圍內分別安裝了'jspm'。以下是檢查版本的結果:'0.17.0-beta.24 針對本地jspm install運行.'當我再次嘗試'npm install'時,發生錯誤。 –

+0

在這種情況下,它可能是'bundle-dep'腳本中的'www/bundle.js'。你在Windows上運行,對吧?該正斜槓可能會混淆cmd。在命令行中嘗試'jspm bundle'src - [src/**/*] - [components/**/*]「」www/bundle.js「'。 –

+0

是的,我在Windows上。我試着運行你給的命令,它有相同的輸出。現在,日誌給了我這個錯誤:'err TypeError:jspm_packages/npm/[email protected]/src/common/directives/observable_list_diff.js:無法讀取'undefined'屬性'indexOf',所以我更新'angular2 @ 2.0.0-beta.15'到'angular2 @ 2.0.0-beta.17',它仍然有相同的輸出。 –