csv-to-json icon indicating copy to clipboard operation
csv-to-json copied to clipboard

Bower:install fatal error

Open ilicmarko opened this issue 9 years ago • 9 comments
trafficstars

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

ilicmarko avatar Dec 30 '15 14:12 ilicmarko

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

tranlm avatar Jan 30 '16 02:01 tranlm

Yup. I got into the same issue too.

archywillhe avatar Mar 05 '16 06:03 archywillhe

same issue - any solutions found?

laurahk avatar Mar 20 '16 15:03 laurahk

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/
                }
            }
        },
....

hhzl avatar Mar 21 '16 08:03 hhzl

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"

laurahk avatar Mar 22 '16 12:03 laurahk

Great @laurahk , thanks. Worked for me too.

gentunian avatar Jul 24 '16 02:07 gentunian

Thanks, worked like a charm!

collinmcrae avatar Apr 12 '17 15:04 collinmcrae

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

haythamdouaihy avatar May 06 '17 20:05 haythamdouaihy

@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.

joejoseph00 avatar Apr 02 '18 17:04 joejoseph00