Last active
March 18, 2018 12:45
-
-
Save visamz/21abbb23812919792fae to your computer and use it in GitHub Desktop.
npm_prompt.lua:11: attempt to concatenate local 'package_version' (a nil value)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c:\cmder/vendor/clink-completions/npm_prompt.lua:11: attempt to concatenate local 'package_version' (a nil value) | |
The solution that worked for me was to edit the file: | |
{YOUR_PATH}/cmder/vendor/clink-completions/npm_prompt.lua | |
and overwrite the related lines to be this instead: | |
The original npm_prompt.lua was (BEFORE FIX) | |
... | |
local package_name = string.match(package_info, '"name"%s*:%s*"(%g-)"') | |
local package_version = string.match(package_info, '"version"%s*:%s*"(.-)"') | |
... | |
and the change is (AFTER FIX): | |
... | |
local package_name = string.match(package_info, '"name"%s*:%s*"(%g-)"') | |
if package_name == nil then | |
package_name = '' | |
end | |
local package_version = string.match(package_info, '"version"%s*:%s*"(.-)"') | |
if package_version == nil then | |
package_version = '' | |
end | |
... | |
``` |
Author
visamz
commented
Mar 2, 2016
+1
Worked for me on version 161009a(stable)
Worked for me :)
An alternative that will completely hide the yellow (@)
if both package_name
and package_version
are nil
:
...
local package_name = string.match(package_info, '"name"%s*:%s*"(%g-)"') -- Unchanged
local package_version = string.match(package_info, '"version"%s*:%s*"(.-)"') -- Unchanged
if package_name == nil and package_version == nil then
return false
end
if package_name == nil then
package_name = ''
end
if package_version == nil then
package_version = ''
end
...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment