When grunt uses grunt-contrib-livereload, it prompts warning: arguments to path.

  node.js, question

Command and Return

P:\ms>grunt live
 Running "livereload-start" task
 ... Starting Livereload server on 35729   ...
 
 Running "connect:livereload" (connect) task
 Warning: Arguments to path.resolve must be strings Use --force to continue.
 
 Aborted due to warnings.

Js section

livereload: {
 port: 35729 // Default livereload listening port.
 },
 connect: {
 livereload: {
 options: {
 port: 9001,
 hostname: 'localhost',
 base: '.',
 middleware: function(connect, options) {
 return [lrSnippet, folderMount(connect, options.base)]
 bracket
 bracket
 bracket
 },
 regarde: {
 jade: {
 files: '*.jade',
 tasks: ['jade']
 },
 html: {
 files: ['index.html', 'css/my.css', 'Gruntfile.js'],
 tasks: ['jsbeautifier', 'livereload']
 },
 coffee: {
 files: 'js/my.coffee',
 tasks: 'coffee'
 bracket
 },
 
 grunt.registerTask('live', ['livereload-start', 'connect', 'regarde']);
  1. Grunt’s version? Please try to upgrade, such problems have been submitted to issues many times, and the upgrade can be solved (including the version of plug-in)

  2. If the upgrade does not work, follow these steps:

    1. npm uninstall grunt-cli -g
    2. npm uninstall grunt -g
    3. npm cache clean -g
    4. npm install grunt-cli -g
  3. Please confirm yours later.grunt --versionInv0.4.1Above

  4. Please make sure you do not have multiple grunt installed.where gruntCheck it out

BTW, don’t use regard and livereload any more. contrib-watch used to use these two only when it was not easy to use. Now watch is simply awesome and configuring livereload is extremely simple.