无法安装Yeoman Angular依赖项

时间:2014-08-26 21:19:50

标签: node.js angularjs npm yeoman bower

我正在尝试使用Yeoman生成Angular框架,但不断出现错误。目录无法将bower_components放入。

我已经阅读了一些其他类似问题的线程,并尝试了以下内容:

  • 使用npm cache clear
  • 清除npm,bower缓存
  • 我还使用sudo chown -R ~/tmp
  • 设置〜/ tmp文件夹,〜/ node_modules文件夹和〜/ .npm文件夹的所有权

有谁知道我的原因是什么?感谢。

C02MH24RFD59:ang-news USER$ yo angular

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |    Welcome to Yeoman,    |
   `---------´   |   ladies and gentlemen!  |
    ( _´U`_ )    '--------------------------'
    /___A___\    
     |  ~  |     
   __'.___.'__   
 ´   `  |° ´ Y ` 

Out of the box I include Bootstrap and some AngularJS recommended modules.

[?] Would you like to use Sass (with Compass)? No
[?] Would you like to include Bootstrap? Yes
[?] Which modules would you like to include? angular-animate.js, angular-cookies.js, angular-resource.js, angular-route.js, angular-sanitize.js, angular-touch.js
   create app/styles/main.css
   create app/index.html
   create bower.json
   create .bowerrc
   create package.json
   create Gruntfile.js
   invoke   angular:common:/usr/local/lib/node_modules/generator-angular/app/index.js
   create     .editorconfig
   create     .gitattributes
   create     .jshintrc
   create     .gitignore
   create     test/.jshintrc
   create     app/.buildignore
   create     app/.htaccess
   create     app/404.html
   create     app/favicon.ico
   create     app/robots.txt
   create     app/views/main.html
   create     app/images/yeoman.png
   invoke   angular:main:/usr/local/lib/node_modules/generator-angular/app/index.js
   create     app/scripts/app.js
   invoke   angular:controller:/usr/local/lib/node_modules/generator-angular/app/index.js
   create     app/scripts/controllers/main.js
   create     test/spec/controllers/main.js
   invoke   karma:app


I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.


   invoke       angular:route
   invoke           angular:controller:/usr/local/lib/node_modules/generator-angular/route/index.js
   create             app/scripts/controllers/about.js
   create             test/spec/controllers/about.js
   invoke           angular:view:/usr/local/lib/node_modules/generator-angular/route/index.js
   create             app/views/about.html
   create     test/karma.conf.js
   create     .travis.yml
npm WARN package.json angnews@0.0.0 No description
npm WARN package.json angnews@0.0.0 No repository field.
npm WARN package.json angnews@0.0.0 No README data
npm WARN package.json angnews@0.0.0 No description
npm WARN package.json angnews@0.0.0 No repository field.
npm WARN package.json angnews@0.0.0 No README data
npm WARN deprecated grunt-ngmin@0.0.3: use grunt-ng-annotate instead
bower json3#~3.3.1               error Request to https://bower.herokuapp.com/packages/json3 failed: UNABLE_TO_VERIFY_LEAF_SIGNATURE

Stack trace:
Error: Request to https://bower.herokuapp.com/packages/json3 failed: UNABLE_TO_VERIFY_LEAF_SIGNATURE
    at createError (/usr/local/lib/node_modules/bower/node_modules/bower-registry-client/lib/util/createError.js:2:15)
    at Request._callback (/usr/local/lib/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js:98:29)
    at self.callback (/usr/local/lib/node_modules/bower/node_modules/bower-registry-client/node_modules/request/request.js:129:22)
    at Request.emit (events.js:95:17)
    at Request.request.emit (/usr/local/lib/node_modules/bower/node_modules/bower-registry-client/node_modules/request-replay/index.js:69:33)
    at ClientRequest.self.clientErrorHandler (/usr/local/lib/node_modules/bower/node_modules/bower-registry-client/node_modules/request/request.js:239:10)
    at ClientRequest.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1547:9)
    at CleartextStream.emit (events.js:95:17)
    at SecurePair.<anonymous> (tls.js:1386:19)

Console trace:
Trace
    at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:72:17)
    at Logger.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:110:22)
    at Logger.emit (events.js:95:17)
    at Logger.emit (/usr/local/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
    at /usr/local/lib/node_modules/bower/lib/commands/index.js:40:20
    at _rejected (/usr/local/lib/node_modules/bower/node_modules/q/q.js:797:24)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:823:30
    at Promise.when (/usr/local/lib/node_modules/bower/node_modules/q/q.js:1035:31)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/node_modules/q/q.js:741:41)
    at /usr/local/lib/node_modules/bower/node_modules/q/q.js:557:44

System info:
Bower version: 1.3.9
Node version: 0.10.31
OS: Darwin 13.3.0 x64
-
/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:84
  if (_.isString(componentConfigFile.main)) {
                                    ^
TypeError: Cannot read property 'main' of undefined
    at findMainFiles (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:84:37)
    at /usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:146:17
    at forOwn (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/lodash/dist/lodash.js:1301:15)
    at Function.forEach (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/lodash/dist/lodash.js:2595:9)
    at detectDependencies (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:28:5)
    at wiredep (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/wiredep.js:57:39)
    at Generator._injectDependencies (/usr/local/lib/node_modules/generator-angular/app/index.js:326:5)
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:232:13
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:113:21
    at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:24:16
npm WARN deprecated ngmin@0.4.1: use ng-annotate instead
npm ERR! EEXIST, mkdir '/Users/USER/code/ang-news/node_modules/grunt/node_modules/findup-sync'
File exists: /Users/USER/code/ang-news/node_modules/grunt/node_modules/findup-sync
Move it away, and try again. 

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/USER/code/ang-news
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /Users/USER/code/ang-news/node_modules/grunt/node_modules/findup-sync
npm ERR! fstream_path /Users/USER/code/ang-news/node_modules/grunt/node_modules/findup-sync/package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)

> phantomjs@1.9.7-15 install /Users/USER/code/ang-news/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js

npm ERR! Error: ENOENT, open '/Users/USER/code/ang-news/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/underscore.string/component.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/USER/code/ang-news
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /Users/USER/code/ang-news/node_modules/grunt/node_modules/grunt-legacy-log/node_modules/underscore.string/component.json
npm ERR! code ENOENT
npm ERR! errno 34
Download already available at /var/folders/6q/n3pmvbf158zbhd2lqjng609c0000gn/T/phantomjs/phantomjs-1.9.7-macosx.zip
Extracting zip contents
Copying extracted folder /var/folders/6q/n3pmvbf158zbhd2lqjng609c0000gn/T/phantomjs/phantomjs-1.9.7-macosx.zip-extract-1409087060976/phantomjs-1.9.7-macosx -> /Users/USER/code/ang-news/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /Users/USER/code/ang-news/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs

> fsevents@0.2.1 install /Users/USER/code/ang-news/node_modules/karma/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

  CXX(target) Release/obj.target/fse/fsevents.o
  SOLINK_MODULE(target) Release/fse.node
  SOLINK_MODULE(target) Release/fse.node: Finished
npm ERR! Error: ENOENT, lstat '/Users/USER/code/ang-news/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/optparse.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "karma-phantomjs-launcher" "karma-jasmine" "grunt-karma" "--save-dev"
npm ERR! cwd /Users/USER/code/ang-news
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /Users/USER/code/ang-news/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/optparse.js
npm ERR! fstream_path /Users/USER/code/ang-news/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/optparse.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! Error: ENOENT, lstat '/Users/USER/code/ang-news/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/USER/code/ang-news
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /Users/USER/code/ang-news/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js
npm ERR! fstream_path /Users/USER/code/ang-news/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/Users/USER/code/ang-news/node_modules/grunt'
npm ERR! error rolling back  grunt@0.4.5 { [Error: ENOTEMPTY, rmdir '/Users/USER/code/ang-news/node_modules/grunt']
npm ERR! error rolling back   errno: 53,
npm ERR! error rolling back   code: 'ENOTEMPTY',
npm ERR! error rolling back   path: '/Users/USER/code/ang-news/node_modules/grunt' }
npm ERR! Error: ENOENT, chmod '/Users/USER/code/ang-news/node_modules/grunt/node_modules/coffee-script/bin/coffee'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/USER/code/ang-news
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /Users/USER/code/ang-news/node_modules/grunt/node_modules/coffee-script/bin/coffee
npm ERR! code ENOENT
npm ERR! errno 34

> ws@0.4.32 install /Users/USER/code/ang-news/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  SOLINK_MODULE(target) Release/bufferutil.node: Finished
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
  SOLINK_MODULE(target) Release/validation.node: Finished
npm ERR! Error: ENOENT, lstat '/Users/USER/code/ang-news/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/USER/code/ang-news
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /Users/USER/code/ang-news/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js
npm ERR! fstream_path /Users/USER/code/ang-news/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (evalmachine.<anonymous>:107:15)
-
> jpegtran-bin@0.2.8 postinstall /Users/USER/code/ang-news/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin
> node index.js

⚠ pre-build test failed, compiling from source...
npm ERR! Error: ENOENT, chmod '/Users/USER/code/ang-news/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "karma-phantomjs-launcher" "karma-jasmine" "grunt-karma" "--save-dev"
npm ERR! cwd /Users/USER/code/ang-news
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /Users/USER/code/ang-news/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/USER/code/ang-news/npm-debug.log
npm ERR! not ok code 0
✖ { [Error: Command failed: rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
configure: error: configuration problem: maybe object file format mismatch.
] killed: false, code: 1, signal: null }
✔︎ jpegtran built successfully!

> optipng-bin@0.3.11 postinstall /Users/USER/code/ang-news/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin
> node index.js

⚠ pre-build test failed, compiling from source...

C02MH24RFD59:ang-news USER$ 
stream.js:94
      throw er; // Unhandled stream error in pipe.
            ^
Error: invalid distance too far back
    at Zlib._binding.onerror (zlib.js:295:17)

> pngquant-bin@0.3.5 postinstall /Users/USER/code/ang-news/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-pngquant/node_modules/pngquant-bin
> node index.js

⚠ pre-build test failed, compiling from source...
✖ pngquant failed to build, make sure that libpng is installed

{ [Error: Command failed: make: *** No rule to make target `config.mk', needed by `lib/libimagequant.a'.  Stop.
] killed: false, code: 2, signal: null }
npm WARN optional dep failed, continuing imagemin-optipng@0.1.0

> gifsicle@0.1.7 postinstall /Users/USER/code/ang-news/node_modules/grunt-contrib-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle
> node index.js

⚠ pre-build test failed, compiling from source...
✔︎ gifsicle built successfully!
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/USER/code/ang-news/npm-debug.log
npm ERR! not ok code 0

以下是我正在运行的版本:

C02MH24RFD59:ang-news USER$ npm --version
1.4.23
C02MH24RFD59:ang-news USER$ bower --version
1.3.9
C02MH24RFD59:ang-news USER$ yo --version
1.2.1

我正在运行Mac OS X Mavericks,我在防火墙和VPN之后。

1 个答案:

答案 0 :(得分:1)

迟到了。它通过安装凉亭得到了修复。

npm install -g bower