Skip to content

Commit bc10c73

Browse files
committed
Improve documentation on common errors
1 parent 7a68797 commit bc10c73

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,37 @@ luarocks test spec/path_to_file.lua --local
7474
busted spec/path_to_file.lua
7575
```
7676

77-
If you see an error like `module 'busted.runner' not found`:
77+
### Common Errors
78+
79+
#### "module "busted.runner" not found" or "pl.path requires LuaFileSystem" Error
80+
81+
If you see one of the errors like the above fix it by
82+
runing the following command the following command:
7883

7984
```bash
8085
eval $(luarocks path --no-bin)
8186
```
8287

83-
For this to work you need to have Lua 5.1 set as your default version for
84-
luarocks. If that's not the case you can pass `--lua-version 5.1` to all the
85-
luarocks commands above.
88+
#### "sh: nlua: command not found" Error
89+
90+
If the error above occurs do[^1]:
91+
92+
##### Linux/Max
93+
94+
Run the following command:
95+
```bash
96+
export PATH=$PATH:~/.luarocks/bin
97+
```
98+
99+
##### Windows
100+
101+
See the following guide to a variable to the PATH: [add to PATH][add-env-vars-windows].
102+
103+
> [!Note]
104+
> For local testing to work you need to have Lua 5.1 set as your default version for
105+
> luarocks. If that's not the case you can pass `--lua-version 5.1` to all the
106+
> luarocks commands above, or set lua version 5.1 globally by running
107+
> `luarocks config --scope system lua_version 5.1`.
86108
87109
[rockspec-format]: https://github.com/luarocks/luarocks/wiki/Rockspec-format
88110
[luarocks]: https://luarocks.org
@@ -91,3 +113,4 @@ luarocks commands above.
91113
[busted]: https://lunarmodules.github.io/busted/
92114
[nlua]: https://github.com/mfussenegger/nlua
93115
[use-this-template]: https://github.com/new?template_name=nvim-lua-plugin-template&template_owner=nvim-lua
116+
[add-env-vars-windows]: https://answers.microsoft.com/en-us/windows/forum/all/adding-path-variable/97300613-20cb-4d85-8d0e-cc9d3549ba23

0 commit comments

Comments
 (0)