I installed grunt in a folder with a project, in the command line it writes this:

... 23 \ Desktop \ cmder / vendor / clink-completions / npm_prompt.lua: 11: attempt to concatenate local 'package) nil value F: \ local serv \ home \ bonsanko.loc {git} {hg}

In another folder, everything is fine

F: \ local serv \ home \ prot.loc (master) (prot.loc@1.0.0)

Tell me what it is and how to fight?

  • Perhaps the versions of grunt and node.js in your project are not suitable for each other? - Mae

1 answer 1

The problem arises because you have no name and version attributes in the package.json file.


In order not to receive this error in the future you need to do the following:

  1. Open the file npm_prompt.lua
  2. Find the following lines in it:

    local package_name = string.match(package_info, '"name"%s*:%s*"(%g-)"') local package_version = string.match(package_info, '"version"%s*:%s*"(.-)"')

  3. Replace them with the following code:

local package_name = string.match(package_info, '"name"%s*:%s*"(%g-)"') if package_name == nil then package_name = '<invalid_name>' end
local package_version = string.match(package_info, '"version"%s*:%s*"(.-)"') if package_version == nil then package_version = '<invalid_version>' end

Or just update Cmder to version 1.3.0 , this error is fixed in it.


It is also worth adding these attributes to the package.json file.

Discussion of a similar problem on Github