cannot load external package on studio code- ubuntu desktop
Posted: Sun Oct 29, 2023 11:39 pm
My > print(package.path)
/usr/local/bin/lua;/usr/local/share/lua/5.4/?.lua;/usr/local/share/lua/5.4/?/init.lua;/usr/local/lib/lua/5.4/?.lua;/usr/local/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua
My > print(package.cpath)
/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/
My echo $LUA_CPATH
/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/
My echo $LUA_PATH
/usr/local/bin/lua;;
my studio code:
seraches on the path i have my
deployment folder.
s. code launch.json file
from command line:
Any suggestion?
/usr/local/bin/lua;/usr/local/share/lua/5.4/?.lua;/usr/local/share/lua/5.4/?/init.lua;/usr/local/lib/lua/5.4/?.lua;/usr/local/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua
My > print(package.cpath)
/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/
My echo $LUA_CPATH
/usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/posix/sys/
My echo $LUA_PATH
/usr/local/bin/lua;;
my studio code:
Code: Select all
module 'posix.signal' not found:
no field package.preload['posix.signal']
no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.lua'
no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.lua'
no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.so'
no file '/home/konstantinos/Desktop/server/lua-apps/posix/signal.so'
no file '/home/konstantinos/Desktop/server/lua-apps/posix.so'
no file '/home/konstantinos/Desktop/server/lua-apps/posix.so'
on local posix = require('posix.signal'),
deployment folder.
s. code launch.json file
Code: Select all
"configurations": [
{
"type": "lua",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/lua.lua",
"cpath": "${env:LUA_CPATH}"
}
]
Code: Select all
lua lua.lua
lua: error loading module 'cjson' from file '/usr/local/bin/lua':
/usr/local/bin/lua:1: unexpected symbol near '<\127>'
stack traceback:
[C]: in ?
[C]: in function 'require'
lua.lua:3559: in main chunk
[C]: in ?