Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bower:install fatal error #9

Open
ilicmarko opened this issue Dec 30, 2015 · 9 comments
Open

Bower:install fatal error #9

ilicmarko opened this issue Dec 30, 2015 · 9 comments

Comments

@ilicmarko
Copy link

There is a fatal error when I try to run grunt command

Running "bower:install" (bower) task
Fatal error: options argument must be an object
@tranlm
Copy link

tranlm commented Jan 30, 2016

I went through all the installation instructions and ran into this issue as well. Anyone have any ideas?
Thanks!

@archywillhe
Copy link

Yup. I got into the same issue too.

@laurahk
Copy link

laurahk commented Mar 20, 2016

same issue - any solutions found?

@hhzl
Copy link

hhzl commented Mar 21, 2016

The Gruntfile.js task for the bower installation causes the problem.

A contribution towards a solution:

Deactivate the bower installation task in the Gruntfile and run the bower installation manually; then grunt runs fine and produces the result in the dist directory

Change 1 to Gruntfile.js: Deactivate bower installation task

  // Default task(s).
    grunt.registerTask('default', [
        'clean:build', // start with a clean slate
        'clean:dist',

        'jshint',     // lint our JS in src/
        'copy:build', // copy our JS from src/ to build/

        // 'bower',              // install Bower components
        'shell:bower_csv-js', // run post-install commands
        'copy:bower',         // copy Bower components to build/lib/

        'copy:dist', // copy everything to dist/

        'clean:build' // cleanup build/
    ]);
};

Change 2 to Gruntfile.js: Deactivate removal of 'bower_components' directory

Part of Gruntfile.js before change

.....
  clean: {
            build: ['build', 'bower_components'],
            dist:  ['dist']
        }
.....

After

......
       clean: {
            build: ['build'],
            dist:  ['dist']
        }
.....

Manual installation with bower

As the Gruntfile.js does now has a deactivated bower installation task run it manually before running grunt.

$ bower install git://github.com/cparker15/CSV-js.git
bower json2#*               not-cached git://github.com/douglascrockford/JSON-js.git#*
bower json2#*                  resolve git://github.com/douglascrockford/JSON-js.git#*
....
bower json2#*                 checkout master
...
csv-js#0.2.5 bower_components/csv-js

json2#c98948ae19 bower_components/json2

Running grunt is fine then

$ grunt
Running "clean:build" (clean) task
Cleaning "bower_components"...OK

Running "clean:dist" (clean) task
Cleaning "dist"...OK

Running "jshint:all" (jshint) task
>> 2 files lint free.

Running "copy:build" (copy) task
Created 2 directories, copied 2 files

Running "shell:bower_csv-js" (shell) task

Running "copy:bower" (copy) task


Running "copy:dist" (copy) task
Created 2 directories, copied 2 files

Running "clean:build" (clean) task
Cleaning "build"...OK

Done, without errors.

Result

The result of the build is in the dist directory. It runs fine.

Need

Fix the file Gruntfile.js so that the bower task runs fine.

The area to fix is

....
  bower: {
            install: {
                options: {
                    copy: false // leave components in bower_components/
                }
            }
        },
....

@laurahk
Copy link

laurahk commented Mar 22, 2016

Thank you very much for the detailed solution. I should have posted earlier, but I actually found that updating to the latest version of bower in package.json solved this issue for me:

"grunt-bower-task": "0.4.0"

@gentunian
Copy link

Great @laurahk , thanks. Worked for me too.

@collinmcrae
Copy link

Thanks, worked like a charm!

@haythamdouaihy
Copy link

haythamdouaihy commented May 6, 2017

The problem is just in NPM dependencies which are outdated; you have to update them to their latest to make the converter work correctly.

@joejoseph00
Copy link

joejoseph00 commented Apr 2, 2018

@haythamdouaihy , @laurahk has a better solution, update the grunt-bower-task to 0.4.0 in the package.json
this works on Ubuntu 16.04.4 with npm and nodejs installed through package manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants