咕噜 bower:install 错误

grunt bower:install error

我是 angularJS 的初学者,我想在一个 bitbucket 克隆的项目上用 npm start 启动节点服务器,但这样做时出现错误。

我尝试了几件事,从防火墙传入和传出设置中取消阻止端口 22 和 运行 这个命令 npm install -g grunt-cli 但没有效果,我仍然得到这个错误

这是我的 npm-debug 文件:

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   'install' ]
2 info using npm@1.4.28
3 info using node@v0.10.36
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 warn package.json wkfs-demo@0.1.0 No repository field.
6 warn package.json wkfs-demo@0.1.0 No README data
7 verbose readDependencies using package.json deps
8 verbose install where, deps [ 'C:\angular_project\wkfs-demo',
8 verbose install   [ 'grunt',
8 verbose install     'grunt-typescript',
8 verbose install     'grunt-tslint',
8 verbose install     'grunt-tsd',
8 verbose install     'grunt-angular-templates',
8 verbose install     'grunt-bower-task',
8 verbose install     'grunt-eslint',
8 verbose install     'grunt-contrib-clean',
8 verbose install     'grunt-contrib-concat',
8 verbose install     'grunt-contrib-copy',
8 verbose install     'grunt-contrib-uglify',
8 verbose install     'grunt-contrib-cssmin',
8 verbose install     'grunt-ng-annotate',
8 verbose install     'grunt-usemin',
8 verbose install     'time-grunt',
8 verbose install     'grunt-karma',
8 verbose install     'grunt-protractor-runner',
8 verbose install     'grunt-protractor-webdriver',
8 verbose install     'karma-chrome-launcher',
8 verbose install     'karma-coverage',
8 verbose install     'karma-html-reporter',
8 verbose install     'karma-jasmine',
8 verbose install     'karma-ng-html2js-preprocessor',
8 verbose install     'karma-phantomjs-launcher',
8 verbose install     'protractor',
8 verbose install     'http-server' ] ]
9 info preinstall wkfs-demo@0.1.0
10 verbose readDependencies using package.json deps
11 verbose already installed skipping grunt@~0.4.5 C:\angular_project\wkfs-demo
12 verbose already installed skipping grunt-typescript@~0.4.6 C:\angular_project\wkfs-demo
13 verbose already installed skipping grunt-tslint@^1.0.1 C:\angular_project\wkfs-demo
14 verbose cache add [ 'grunt-tsd@next', null ]
15 verbose cache add name=undefined spec="grunt-tsd@next" args=["grunt-tsd@next",null]
16 verbose parsed url { protocol: null,
16 verbose parsed url   slashes: null,
16 verbose parsed url   auth: null,
16 verbose parsed url   host: null,
16 verbose parsed url   port: null,
16 verbose parsed url   hostname: null,
16 verbose parsed url   hash: null,
16 verbose parsed url   search: null,
16 verbose parsed url   query: null,
16 verbose parsed url   pathname: 'grunt-tsd@next',
16 verbose parsed url   path: 'grunt-tsd@next',
16 verbose parsed url   href: 'grunt-tsd@next' }
17 verbose already installed skipping grunt-angular-templates@~0.5.7 C:\angular_project\wkfs-demo
18 verbose already installed skipping grunt-bower-task@^0.4.0 C:\angular_project\wkfs-demo
19 verbose already installed skipping grunt-eslint@^2.0.0 C:\angular_project\wkfs-demo
20 verbose already installed skipping grunt-contrib-clean@^0.6.0 C:\angular_project\wkfs-demo
21 verbose already installed skipping grunt-contrib-concat@^0.5.0 C:\angular_project\wkfs-demo
22 verbose already installed skipping grunt-contrib-copy@^0.7.0 C:\angular_project\wkfs-demo
23 verbose already installed skipping grunt-contrib-uglify@^0.6.0 C:\angular_project\wkfs-demo
24 verbose already installed skipping grunt-contrib-cssmin@^0.10.0 C:\angular_project\wkfs-demo
25 verbose already installed skipping grunt-ng-annotate@^0.7.0 C:\angular_project\wkfs-demo
26 verbose already installed skipping grunt-usemin@^2.6.2 C:\angular_project\wkfs-demo
27 verbose already installed skipping time-grunt@^1.0.0 C:\angular_project\wkfs-demo
28 verbose already installed skipping grunt-karma@0.9.0 C:\angular_project\wkfs-demo
29 verbose already installed skipping grunt-protractor-runner@^1.1.4 C:\angular_project\wkfs-demo
30 verbose cache add name="grunt-tsd" spec="next" args=["grunt-tsd","next"]
31 verbose parsed url { protocol: null,
31 verbose parsed url   slashes: null,
31 verbose parsed url   auth: null,
31 verbose parsed url   host: null,
31 verbose parsed url   port: null,
31 verbose parsed url   hostname: null,
31 verbose parsed url   hash: null,
31 verbose parsed url   search: null,
31 verbose parsed url   query: null,
31 verbose parsed url   pathname: 'next',
31 verbose parsed url   path: 'next',
31 verbose parsed url   href: 'next' }
32 verbose addNamed [ 'grunt-tsd', 'next' ]
33 verbose addNamed [ null, null ]
34 silly lockFile f5640f9e-grunt-tsd-next grunt-tsd@next
35 verbose lock grunt-tsd@next C:\Users\aurel.deac\AppData\Roaming\npm-cache\f5640f9e-grunt-tsd-next.lock
36 info addNameTag [ 'grunt-tsd', 'next' ]
37 verbose request where is /grunt-tsd
38 verbose request registry http://int-build.wkfs-frc.local:4873/
39 verbose request id d2a1ac53e4175bbc
40 verbose url raw /grunt-tsd
41 verbose url resolving [ 'http://int-build.wkfs-frc.local:4873/', './grunt-tsd' ]
42 verbose url resolved http://int-build.wkfs-frc.local:4873/grunt-tsd
43 verbose request where is http://int-build.wkfs-frc.local:4873/grunt-tsd
44 info trying registry request attempt 1 at 12:20:54
45 verbose etag "e12d92cab773b8405bf82b2507fb6c5f"
46 http GET http://int-build.wkfs-frc.local:4873/grunt-tsd
47 verbose already installed skipping grunt-protractor-webdriver@^0.1.9 C:\angular_project\wkfs-demo
48 verbose already installed skipping karma-chrome-launcher@^0.1.5 C:\angular_project\wkfs-demo
49 verbose already installed skipping karma-coverage@^0.2.6 C:\angular_project\wkfs-demo
50 verbose already installed skipping karma-html-reporter@^0.2.4 C:\angular_project\wkfs-demo
51 verbose already installed skipping karma-jasmine@^0.2.3 C:\angular_project\wkfs-demo
52 verbose already installed skipping karma-ng-html2js-preprocessor@~0.1 C:\angular_project\wkfs-demo
53 verbose already installed skipping karma-phantomjs-launcher@^0.1.4 C:\angular_project\wkfs-demo
54 verbose already installed skipping protractor@^1.3.1 C:\angular_project\wkfs-demo
55 verbose already installed skipping http-server@^0.7.4 C:\angular_project\wkfs-demo
56 http 304 http://int-build.wkfs-frc.local:4873/grunt-tsd
57 silly registry.get cb [ 304,
57 silly registry.get   { 'x-powered-by': 'Sinopia/1.0.1',
57 silly registry.get     etag: '"e12d92cab773b8405bf82b2507fb6c5f"',
57 silly registry.get     'x-status-cat': 'http://flic.kr/p/aXY3dH',
57 silly registry.get     date: 'Tue, 10 Mar 2015 10:19:35 GMT',
57 silly registry.get     connection: 'keep-alive' } ]
58 verbose etag http://int-build.wkfs-frc.local:4873/grunt-tsd from cache
59 verbose addNamed [ 'grunt-tsd', '0.2.0-beta.1' ]
60 verbose addNamed [ '0.2.0-beta.1', '0.2.0-beta.1' ]
61 silly lockFile 18eefc5b-grunt-tsd-0-2-0-beta-1 grunt-tsd@0.2.0-beta.1
62 verbose lock grunt-tsd@0.2.0-beta.1 C:\Users\aurel.deac\AppData\Roaming\npm-cacheeefc5b-grunt-tsd-0-2-0-beta-1.lock
63 silly lockFile 18eefc5b-grunt-tsd-0-2-0-beta-1 grunt-tsd@0.2.0-beta.1
64 silly lockFile 18eefc5b-grunt-tsd-0-2-0-beta-1 grunt-tsd@0.2.0-beta.1
65 silly lockFile f5640f9e-grunt-tsd-next grunt-tsd@next
66 silly lockFile f5640f9e-grunt-tsd-next grunt-tsd@next
67 info already installed grunt-tsd@0.2.0-beta.1
68 silly resolved []
69 info build C:\angular_project\wkfs-demo
70 verbose linkStuff [ false, false, false, 'C:\angular_project' ]
71 info linkStuff wkfs-demo@0.1.0
72 verbose linkBins wkfs-demo@0.1.0
73 verbose linkMans wkfs-demo@0.1.0
74 verbose rebuildBundles wkfs-demo@0.1.0
75 verbose rebuildBundles [ '.bin',
75 verbose rebuildBundles   'bower',
75 verbose rebuildBundles   'grunt',
75 verbose rebuildBundles   'grunt-angular-templates',
75 verbose rebuildBundles   'grunt-bower-task',
75 verbose rebuildBundles   'grunt-contrib-clean',
75 verbose rebuildBundles   'grunt-contrib-concat',
75 verbose rebuildBundles   'grunt-contrib-copy',
75 verbose rebuildBundles   'grunt-contrib-cssmin',
75 verbose rebuildBundles   'grunt-contrib-uglify',
75 verbose rebuildBundles   'grunt-eslint',
75 verbose rebuildBundles   'grunt-karma',
75 verbose rebuildBundles   'grunt-ng-annotate',
75 verbose rebuildBundles   'grunt-protractor-runner',
75 verbose rebuildBundles   'grunt-protractor-webdriver',
75 verbose rebuildBundles   'grunt-tsd',
75 verbose rebuildBundles   'grunt-tslint',
75 verbose rebuildBundles   'grunt-typescript',
75 verbose rebuildBundles   'grunt-usemin',
75 verbose rebuildBundles   'http-server',
75 verbose rebuildBundles   'karma',
75 verbose rebuildBundles   'karma-chrome-launcher',
75 verbose rebuildBundles   'karma-coverage',
75 verbose rebuildBundles   'karma-html-reporter',
75 verbose rebuildBundles   'karma-jasmine',
75 verbose rebuildBundles   'karma-ng-html2js-preprocessor',
75 verbose rebuildBundles   'karma-phantomjs-launcher',
75 verbose rebuildBundles   'protractor',
75 verbose rebuildBundles   'time-grunt',
75 verbose rebuildBundles   'typescript' ]
76 verbose rebuild bundle C:\angular_project\wkfs-demo\node_modules\bower
77 info build C:\angular_project\wkfs-demo\node_modules\bower
78 info preinstall bower@1.3.12
79 verbose linkStuff [ false,
79 verbose linkStuff   false,
79 verbose linkStuff   false,
79 verbose linkStuff   'C:\angular_project\wkfs-demo\node_modules' ]
80 info linkStuff bower@1.3.12
81 warn prefer global bower@1.3.12 should be installed with -g
82 verbose linkBins bower@1.3.12
83 verbose link bins [ { bower: 'bin/bower' },
83 verbose link bins   'C:\angular_project\wkfs-demo\node_modules\.bin',
83 verbose link bins   false ]
84 verbose linkMans bower@1.3.12
85 verbose rebuildBundles bower@1.3.12
86 verbose rebuildBundles [ '.bin',
86 verbose rebuildBundles   'abbrev',
86 verbose rebuildBundles   'archy',
86 verbose rebuildBundles   'bower-config',
86 verbose rebuildBundles   'bower-endpoint-parser',
86 verbose rebuildBundles   'bower-json',
86 verbose rebuildBundles   'bower-logger',
86 verbose rebuildBundles   'bower-registry-client',
86 verbose rebuildBundles   'cardinal',
86 verbose rebuildBundles   'chalk',
86 verbose rebuildBundles   'chmodr',
86 verbose rebuildBundles   'decompress-zip',
86 verbose rebuildBundles   'fstream',
86 verbose rebuildBundles   'fstream-ignore',
86 verbose rebuildBundles   'glob',
86 verbose rebuildBundles   'graceful-fs',
86 verbose rebuildBundles   'handlebars',
86 verbose rebuildBundles   'inquirer',
86 verbose rebuildBundles   'insight',
86 verbose rebuildBundles   'is-root',
86 verbose rebuildBundles   'junk',
86 verbose rebuildBundles   'lockfile',
86 verbose rebuildBundles   'lru-cache',
86 verbose rebuildBundles   'mkdirp',
86 verbose rebuildBundles   'mout',
86 verbose rebuildBundles   'nopt',
86 verbose rebuildBundles   'opn',
86 verbose rebuildBundles   'osenv',
86 verbose rebuildBundles   'p-throttler',
86 verbose rebuildBundles   'promptly',
86 verbose rebuildBundles   'q',
86 verbose rebuildBundles   'request',
86 verbose rebuildBundles   'request-progress',
86 verbose rebuildBundles   'retry',
86 verbose rebuildBundles   'rimraf',
86 verbose rebuildBundles   'semver',
86 verbose rebuildBundles   'shell-quote',
86 verbose rebuildBundles   'stringify-object',
86 verbose rebuildBundles   'tar-fs',
86 verbose rebuildBundles   'tmp',
86 verbose rebuildBundles   'update-notifier',
86 verbose rebuildBundles   'which' ]
87 info install bower@1.3.12
88 info postinstall bower@1.3.12
89 verbose rebuild bundle C:\angular_project\wkfs-demo\node_modules\karma
90 info build C:\angular_project\wkfs-demo\node_modules\karma
91 info preinstall karma@0.12.31
92 verbose linkStuff [ false,
92 verbose linkStuff   false,
92 verbose linkStuff   false,
92 verbose linkStuff   'C:\angular_project\wkfs-demo\node_modules' ]
93 info linkStuff karma@0.12.31
94 verbose linkBins karma@0.12.31
95 verbose link bins [ {},
95 verbose link bins   'C:\angular_project\wkfs-demo\node_modules\.bin',
95 verbose link bins   false ]
96 verbose linkMans karma@0.12.31
97 verbose rebuildBundles karma@0.12.31
98 verbose rebuildBundles [ '.bin',
98 verbose rebuildBundles   'chokidar',
98 verbose rebuildBundles   'colors',
98 verbose rebuildBundles   'connect',
98 verbose rebuildBundles   'di',
98 verbose rebuildBundles   'glob',
98 verbose rebuildBundles   'graceful-fs',
98 verbose rebuildBundles   'http-proxy',
98 verbose rebuildBundles   'lodash',
98 verbose rebuildBundles   'log4js',
98 verbose rebuildBundles   'mime',
98 verbose rebuildBundles   'minimatch',
98 verbose rebuildBundles   'optimist',
98 verbose rebuildBundles   'q',
98 verbose rebuildBundles   'rimraf',
98 verbose rebuildBundles   'socket.io',
98 verbose rebuildBundles   'source-map',
98 verbose rebuildBundles   'useragent' ]
99 info install karma@0.12.31
100 info postinstall karma@0.12.31
101 verbose rebuild bundle C:\angular_project\wkfs-demo\node_modules\typescript
102 info build C:\angular_project\wkfs-demo\node_modules\typescript
103 info preinstall typescript@1.3.0
104 verbose linkStuff [ false,
104 verbose linkStuff   false,
104 verbose linkStuff   false,
104 verbose linkStuff   'C:\angular_project\wkfs-demo\node_modules' ]
105 info linkStuff typescript@1.3.0
106 warn prefer global typescript@1.3.0 should be installed with -g
107 verbose linkBins typescript@1.3.0
108 verbose link bins [ { tsc: './bin/tsc' },
108 verbose link bins   'C:\angular_project\wkfs-demo\node_modules\.bin',
108 verbose link bins   false ]
109 verbose linkMans typescript@1.3.0
110 verbose rebuildBundles typescript@1.3.0
111 info install typescript@1.3.0
112 info postinstall typescript@1.3.0
113 info install wkfs-demo@0.1.0
114 info postinstall wkfs-demo@0.1.0
115 verbose unsafe-perm in lifecycle true
116 info wkfs-demo@0.1.0 Failed to exec postinstall script
117 error wkfs-demo@0.1.0 postinstall: `grunt bower:install`
117 error Exit status 1
118 error Failed at the wkfs-demo@0.1.0 postinstall script.
118 error This is most likely a problem with the wkfs-demo package,
118 error not with npm itself.
118 error Tell the author that this fails on your system:
118 error     grunt bower:install
118 error You can get their info via:
118 error     npm owner ls wkfs-demo
118 error There is likely additional logging output above.
119 error System Windows_NT 6.1.7601
120 error command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
121 error cwd C:\angular_project\wkfs-demo
122 error node -v v0.10.36
123 error npm -v 1.4.28
124 error code ELIFECYCLE
125 verbose exit [ 1, true ]

当我 运行 grunt bower:install 我得到

Fatal error: Failed to execute "git ls-remote --tags --heads git://github.com/angular/bowler-angular-route.git", exit code of #128

这是 package.json 文件:

    {
  "name": "wkfs-demo",
  "namelower": "wkfs-demo",
  "version": "0.1.0",
  "description": "WKFS Angular.js Demo",
  "author": "wkfs-frc",
  "main": " ",
  "dependencies": {
  },
  "devDependencies": {
    "grunt": "~0.4.5",
    "grunt-typescript": "~0.4.6",
    "grunt-tslint": "^1.0.1",
    "grunt-tsd": "next",
    "grunt-angular-templates": "~0.5.7",
    "grunt-bower-task": "^0.4.0",
    "grunt-eslint": "^2.0.0",
    "grunt-contrib-clean": "^0.6.0",
    "grunt-contrib-concat": "^0.5.0",
    "grunt-contrib-copy": "^0.7.0",
    "grunt-contrib-uglify": "^0.6.0",
    "grunt-contrib-cssmin": "^0.10.0",
    "grunt-ng-annotate": "^0.7.0",
    "grunt-usemin": "^2.6.2",
    "time-grunt": "^1.0.0",
    "grunt-karma": "0.9.0",
    "grunt-protractor-runner": "^1.1.4",
    "grunt-protractor-webdriver": "^0.1.9",
    "karma-chrome-launcher": "^0.1.5",
    "karma-coverage": "^0.2.6",
    "karma-html-reporter": "^0.2.4",
    "karma-jasmine": "^0.2.3",
    "karma-ng-html2js-preprocessor": "~0.1",
    "karma-phantomjs-launcher": "^0.1.4",
    "protractor": "^1.3.1",
    "http-server": "^0.7.4"
  },
  "scripts": {
    "postinstall": "grunt bower:install",

    "prestart": "npm install",
    "start": "http-server -a 0.0.0.0 -p 8000"
  }
}

和bower.json文件:

{
  "name": "wkfs-demo",
  "version": "0.0.1",
  "description": "WKFS Angular.js Demo",
  "authors": [
    "wkfs-frc"
  ],
  "private": true,
  "ignore": [
  ],
  "dependencies": {
    "angular": "1.3.0",
    "angular-resource": "1.3.0",
    "angular-route": "1.3.0",
    "jquery": "2.1.1",
    "bootstrap": "~3.3.1"
  },
  "devDependencies": {
    "angular-mocks": "1.3.0"
  }
}

感谢您的帮助!

answergit config --global url."https://".insteadOf http://,这意味着您 git 替换了协议。我认为这会将 git 配置为使用 https 端口,而不是默认的 git 端口,即被阻止的 22 或其他端口。如果能有更清楚的解释,我将不胜感激。