csv-to-json
csv-to-json copied to clipboard
Bower:install fatal error
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
I went through all the installation instructions and ran into this issue as well. Anyone have any ideas? Thanks!
Yup. I got into the same issue too.
same issue - any solutions found?
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/
}
}
},
....
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"
Great @laurahk , thanks. Worked for me too.
Thanks, worked like a charm!
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 , @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.