luvit-redis
luvit-redis copied to clipboard
can't use in my code
When I install complete I can't use it in my code like this yangzhu:jcpvp yangzhu$ luvit app.lua 109 /usr/local/lib/luvit/luvit.lua:309: /usr/local/lib/luvit/module.lua:194: Failed to find module 'redis' no field package.preload['redis'] Cannot find module /usr/local/lib/luvit/redis Cannot find module /Users/yangzhu/Documents/work/jcpvp/modules/redis Cannot find module /Users/yangzhu/Documents/work/jcpvp/node_modules/redis Cannot find module /Users/yangzhu/Documents/work/modules/redis Cannot find module /Users/yangzhu/Documents/work/node_modules/redis Cannot find module /Users/yangzhu/Documents/modules/redis Cannot find module /Users/yangzhu/Documents/node_modules/redis Cannot find module /Users/yangzhu/modules/redis Cannot find module /Users/yangzhu/node_modules/redis Cannot find module /Users/modules/redis Cannot find module /Users/node_modules/redis Cannot find module /modules/redis Cannot find module /node_modules/redis
Has been solved
local Redis = require('luvit-redis.lib.init') _G.redis = Redis:new("192.168.100.226", 6379) redis:on("error", function (err) print("Error (error callback): ", err) end)