D
Deno

help

Installing a deno script

Ccaptainbuckkets10/19/2023
I have a deno script that I've written that takes a single arg. I want to install it so that I can call "tricky" in the same way I call "deno". I did deno install -A -n tricky .\main.js
and it said installed successfully but when I try to call it from the command line like "tricky <script-path>" it says its not recognized Was referencing this to achieve this https://docs.deno.com/runtime/manual/tools/script_installer#:~:text=Deno%20provides%20deno%20install%20to,CLI%20flags%20and%20main%20module.
Script Installer | Deno Docs
Deno provides deno install to easily install and distribute executable code.
Ccaptainbuckkets10/19/2023
Seems like it works on WSL but not on windows when deno is installed through chocolatey
DAHDeno AI Helper10/19/2023
The deno install command should have created an executable script named tricky in the Deno installation root's bin directory. However, it seems like your system is not recognizing this new command. This could be because the Deno bin directory is not in your system's PATH. The installation root is determined in the following order of precedence: 1. --root option 2. DENO_INSTALL_ROOT environment variable 3. $HOME/.deno If you didn't specify a --root option or DENO_INSTALL_ROOT environment variable, the script is likely installed in $HOME/.deno/bin. You can add this directory to your PATH manually. If you're using a Unix-like operating system, you can do this by adding the following line to your shell profile file (like ~/.bashrc or ~/.bash_profile for bash):
export PATH="$HOME/.deno/bin:$PATH"
export PATH="$HOME/.deno/bin:$PATH"
Then, you need to source your profile file for the changes to take effect:
source ~/.bashrc
source ~/.bashrc
Or, if you're using a different shell or profile file:
source ~/.bash_profile
source ~/.bash_profile
If you're on Windows, you'll need to add the directory to your PATH through the System Properties. After doing this, you should be able to use the tricky command from any location in your terminal. If you're still having issues, please let me know! 🦕
Ccaptainbuckkets10/19/2023
Even after installing it on the linux side for WSL, its not accessible from another directory But using "export PATH="$HOME/.deno/bin:$PATH" made it accessable

Looking for more? Join the community!