4

i just got this macbook pro and ofcourse installed the latest version of angular-generator yeoman, and i get a mountain of errors when I ran it, and I reinstalled yo, and angular-generator numerous times before I tried to do `sudo yo angular

macs-mbp-2:yeoman myUser$ sudo npm install -g yo
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js

> [email protected] postinstall /usr/local/lib/node_modules/yo
> node ./scripts/doctor

[Yeoman Doctor] Everything looks alright!

npm WARN unmet dependency /usr/local/lib/node_modules/bower requires insight@'~0.3.0' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/insight,
npm WARN unmet dependency which is version 0.4.0
[email protected] /usr/local/lib/node_modules/yo
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
macs-mbp-2:yeoman myUser$ yo angular myApp

     _-----_
    |       |    .--------------------------.
    |--(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? No
[?] 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
identical .bowerrc
   create package.json
   create Gruntfile.js
   invoke   angular:common:/usr/local/lib/node_modules/generator-angular/app/index.js
identical     .editorconfig
identical     .gitattributes
identical     .jshintrc
identical     .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
identical     .travis.yml

module.js:340
    throw err;
          ^
Error: Cannot find module 'handlebars'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/bower/lib/util/template.js:3:18)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

/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
macs-mbp-2:yeoman myUser$ npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm WARN deprecated [email protected]: use grunt-ng-annotate instead
npm ERR! Error: EACCES, open '/Users/myUser/.npm/lodash/2.4.1/package/package.json'
npm ERR!  { [Error: EACCES, open '/Users/myUser/.npm/lodash/2.4.1/package/package.json']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/myUser/.npm/lodash/2.4.1/package/package.json',
npm ERR!   parent: 'grunt-karma' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "karma-phantomjs-launcher" "karma-jasmine" "grunt-karma" "--save-dev"
npm ERR! cwd /Applications/MAMP/htdocs/yeoman
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/myUser/.npm/lodash/2.4.1/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/myUser/.npm/lodash/2.4.1/package/package.json'
npm ERR! Error: EACCES, open '/Users/myUser/.npm/lodash/2.4.1/package/package.json'
npm ERR!  { [Error: EACCES, open '/Users/myUser/.npm/lodash/2.4.1/package/package.json']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/myUser/.npm/lodash/2.4.1/package/package.json',
npm ERR!   parent: 'grunt-contrib-watch' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Applications/MAMP/htdocs/yeoman
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/myUser/.npm/lodash/2.4.1/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/myUser/.npm/lodash/2.4.1/package/package.json'
npm WARN deprecated [email protected]: use ng-annotate instead
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Applications/MAMP/htdocs/yeoman/npm-debug.log
npm ERR! not ok code 0
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Applications/MAMP/htdocs/yeoman/npm-debug.log
npm ERR! not ok code 0
macs-mbp-2:yeoman myUser$ 

isn't this supposed to be easier on mac?

I tried sudo yo angular app anbd all i get is this.

/usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/mkdirp/index.js:74
                    throw err0;
                          ^
Error: EACCES, permission denied '/Applications/MAMP/htdocs/yeoman/app'
    at Object.fs.mkdirSync (fs.js:647:18)
    at sync (/usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/mkdirp/index.js:55:12)
    at Function.sync (/usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/mkdirp/index.js:61:24)
    at Generator.<anonymous> (/usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/lib/actions/actions.js:106:12)
    at processImmediate [as _immediateCallback] (timers.js:336:15)
user2167582
  • 5,986
  • 13
  • 64
  • 121

1 Answers1

6

This is a known issue. Please set the correct node write permissions with

sudo chown -R `whoami` ~/.npm
sudo chown -R `whoami` /usr/local/lib/node_modules

and try again.

Community
  • 1
  • 1
montecruiseto
  • 544
  • 3
  • 11
  • 1
    weird i done this command at least three times today, but this time it worked for the 4th time. – user2167582 Jul 28 '14 at 01:11
  • I don't have that second directory, but I do have two other suspects: 1) /usr/local/n/versions/0.10.13/lib/node_modules/ (I have used nvm to install node) and 2) ~/.node/lib/node_modules/ – Per Quested Aronsson Dec 03 '14 at 07:55