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:
- Open the file
npm_prompt.lua 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*"(.-)"')
- 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