yatskevich / grunt-bower-task

Grunt plugin for Bower
MIT License
490 stars 120 forks source link

Issue installing certain dependencies #134

Open anthonator opened 10 years ago

anthonator commented 10 years ago

I'm not exactly sure how to describe this one. I've got a couple packages in my bower.json that won't copy over to my targetDir. It's not entirely consistent though. It only has trouble copying over one package at a time.

For instance, I have the jsx-requirejs-plugin and requirejs-text dependencies defined in my bower.json. Whenever I run grunt bower:install I get:

Fatal error: ENOENT, no such file or directory 'vendor/assets/components/jsx-requirejs-plugin'

If I remove jsx-requirejs-plugin I then get:

Fatal error: ENOENT, no such file or directory 'vendor/assets/components/requirejs-text'

If I then remove requirejs-text then grunt bower:install works.

If I just do a straight up bower install I don't have any problems. Everything shows up properly in my targetDir.

If I look in my targetDir when the errors occur then the package that's having issues is not there. So if jsx-requirejs-plugin is having issues it will not be in the targetDir but requirejs-text will.

bower.json

{
  "name": "drinking-buddy",
  "dependencies": {
    "backbone":             "~> 1.1.0",
    "backbone-relational":  "~> 0.8.0",
    "bootstrap":            "~> 3.2.0",
    "chance":               "~> 0.5.0",
    "font-awesome":         "~> 4.1.0",
    "ionicons":             "~> 1.5.0",
    "jQuery-Mask-Plugin":   "~> 1.6.0",
    "jsx-requirejs-plugin": "~> 0.3.0",
    "react":                "~> 0.11.0",
    "requirejs":            "~> 2.1.0",
    "requirejs-text":       "~> 2.0.0",
    "underscore":           "~> 1.6.0"
  }
}

Gruntfile.js

module.exports = function(grunt) {
  grunt.loadNpmTasks('grunt-bower-task');

  grunt.initConfig({
    bower: {
      install: {
        options: {
          targetDir: './vendor/assets/components',
          verbose: true
        }
      }
    }
  });
}

package.json

{
  "name": "***",
  "version": "1.0.0",
  "dependencies": {
    "bower": "~> 1.3.0"
  },
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-bower-task": "^0.4.0",
    "grunt-cli": "^0.1.13",
    "grunt-contrib-requirejs": "~> 0.4.0"
  },
  "engines": {
    "node": "0.10.x",
    "npm": "1.4.x"
  },
  "scripts": {
    "postinstall": "./node_modules/.bin/grunt bower:install"
  }
}

.bowerrc

{
  "directory": "vendor/assets/components"
}

Log Output

bower cached git://github.com/jashkenas/backbone.git#1.1.2
bower validate 1.1.2 against git://github.com/jashkenas/backbone.git#~> 1.1.0
bower cached git://github.com/PaulUithol/Backbone-relational.git#0.8.8
bower validate 0.8.8 against git://github.com/PaulUithol/Backbone-relational.git#~> 0.8.0
bower cached git://github.com/victorquinn/chancejs.git#0.5.6
bower validate 0.5.6 against git://github.com/victorquinn/chancejs.git#~> 0.5.0
bower cached git://github.com/FortAwesome/Font-Awesome.git#4.1.0
bower validate 4.1.0 against git://github.com/FortAwesome/Font-Awesome.git#~> 4.1.0
bower cached git://github.com/twbs/bootstrap.git#3.2.0
bower validate 3.2.0 against git://github.com/twbs/bootstrap.git#~> 3.2.0
bower cached git://github.com/philix/jsx-requirejs-plugin.git#0.3.0
bower validate 0.3.0 against git://github.com/philix/jsx-requirejs-plugin.git#~> 0.3.0
bower cached git://github.com/driftyco/ionicons.git#1.5.2
bower validate 1.5.2 against git://github.com/driftyco/ionicons.git#~> 1.5.0
bower cached git://github.com/jrburke/requirejs-bower.git#2.1.14
bower validate 2.1.14 against git://github.com/jrburke/requirejs-bower.git#~> 2.1.0
bower cached git://github.com/igorescobar/jQuery-Mask-Plugin.git#1.6.5
bower validate 1.6.5 against git://github.com/igorescobar/jQuery-Mask-Plugin.git#~> 1.6.0
bower cached git://github.com/facebook/react-bower.git#0.11.1
bower validate 0.11.1 against git://github.com/facebook/react-bower.git#~> 0.11.0
bower cached git://github.com/jashkenas/underscore.git#1.6.0
bower validate 1.6.0 against git://github.com/jashkenas/underscore.git#~> 1.6.0
bower cached git://github.com/requirejs/text.git#2.0.12
bower validate 2.0.12 against git://github.com/requirejs/text.git#~> 2.0.0
bower cached git://github.com/jashkenas/backbone.git#1.1.2
bower validate 1.1.2 against git://github.com/jashkenas/backbone.git#>=1.1.2
bower cached git://github.com/jashkenas/underscore.git#1.7.0
bower validate 1.7.0 against git://github.com/jashkenas/underscore.git#>=1.5.0
bower cached git://github.com/jquery/jquery.git#2.1.1
bower validate 2.1.1 against git://github.com/jquery/jquery.git#>= 1.9.0
bower install jsx-requirejs-plugin#0.3.0
bower install requirejs-text#2.0.12
bower install requirejs#2.1.14
bower install ionicons#1.5.2
bower install react#0.11.1
bower install jQuery-Mask-Plugin#1.6.5
bower install chance#0.5.6
bower install backbone-relational#0.8.8
bower install font-awesome#4.1.0
bower install underscore#1.6.0
bower install backbone#1.1.2
bower install bootstrap#3.2.0
bower install jquery#2.1.1
>> Installed bower packages
grunt-bower copying vendor/assets/components/backbone-relational/backbone-relational.js -> vendor/assets/components/backbone-relational/backbone-relational.js
grunt-bower copying vendor/assets/components/backbone/backbone.js -> vendor/assets/components/backbone/backbone.js
grunt-bower copying vendor/assets/components/chance/chance.js -> vendor/assets/components/chance/chance.js
grunt-bower copying vendor/assets/components/bootstrap/less/bootstrap.less -> vendor/assets/components/bootstrap/bootstrap.less
grunt-bower copying vendor/assets/components/bootstrap/dist/css/bootstrap.css -> vendor/assets/components/bootstrap/bootstrap.css
grunt-bower copying vendor/assets/components/bootstrap/dist/js/bootstrap.js -> vendor/assets/components/bootstrap/bootstrap.js
grunt-bower copying vendor/assets/components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -> vendor/assets/components/bootstrap/glyphicons-halflings-regular.eot
grunt-bower copying vendor/assets/components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg -> vendor/assets/components/bootstrap/glyphicons-halflings-regular.svg
grunt-bower copying vendor/assets/components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -> vendor/assets/components/bootstrap/glyphicons-halflings-regular.ttf
grunt-bower copying vendor/assets/components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -> vendor/assets/components/bootstrap/glyphicons-halflings-regular.woff
grunt-bower copying vendor/assets/components/font-awesome/css/font-awesome.css -> vendor/assets/components/font-awesome/font-awesome.css
grunt-bower copying vendor/assets/components/font-awesome/fonts/FontAwesome.otf -> vendor/assets/components/font-awesome/FontAwesome.otf
grunt-bower copying vendor/assets/components/font-awesome/fonts/fontawesome-webfont.eot -> vendor/assets/components/font-awesome/fontawesome-webfont.eot
grunt-bower copying vendor/assets/components/font-awesome/fonts/fontawesome-webfont.svg -> vendor/assets/components/font-awesome/fontawesome-webfont.svg
grunt-bower copying vendor/assets/components/font-awesome/fonts/fontawesome-webfont.ttf -> vendor/assets/components/font-awesome/fontawesome-webfont.ttf
grunt-bower copying vendor/assets/components/font-awesome/fonts/fontawesome-webfont.woff -> vendor/assets/components/font-awesome/fontawesome-webfont.woff
grunt-bower copying vendor/assets/components/ionicons/css/ionicons.css -> vendor/assets/components/ionicons/ionicons.css
grunt-bower copying vendor/assets/components/ionicons/fonts/ionicons.eot -> vendor/assets/components/ionicons/ionicons.eot
grunt-bower copying vendor/assets/components/ionicons/fonts/ionicons.svg -> vendor/assets/components/ionicons/ionicons.svg
grunt-bower copying vendor/assets/components/ionicons/fonts/ionicons.ttf -> vendor/assets/components/ionicons/ionicons.ttf
grunt-bower copying vendor/assets/components/ionicons/fonts/ionicons.woff -> vendor/assets/components/ionicons/ionicons.woff
grunt-bower copying vendor/assets/components/jQuery-Mask-Plugin/jquery.mask.min.js -> vendor/assets/components/jQuery-Mask-Plugin/jquery.mask.min.js
grunt-bower copying vendor/assets/components/jquery/dist/jquery.js -> vendor/assets/components/jquery/jquery.js
Fatal error: ENOENT, no such file or directory 'vendor/assets/components/jsx-requirejs-plugin'
Zensavona commented 10 years ago

+1 I am also experiencing this issue. I thought it was supposed to be fixed in 0.3.x?

Zensavona commented 10 years ago

hey @anthonator just FYI I have a fix for this:

in your Gruntfile.js underneath targetDir and verbose add another property called copy and set it to false (it's true by default). This makes the issue go away :smile:

Your Gruntfile.js should look like this:

module.exports = function(grunt) {
  grunt.loadNpmTasks('grunt-bower-task');

  grunt.initConfig({
    bower: {
      install: {
        options: {
          targetDir: './vendor/assets/components',
          verbose: true,
          copy: false
        }
      }
    }
  });
}

enjoy :heart:

plato-cambrian commented 10 years ago

Anyone here have suggestions for my issue https://github.com/yatskevich/grunt-bower-task/issues/137

chreestopher commented 9 years ago

thank you Zensavona! that worked!

TroodoNmike commented 9 years ago

I have similar problem. It removes my last package for no reason. Manual bower install has no problem with it. The solution suggested Zesenova by adding copy: false works for me.