Giving the right location for JsBarcode.all.min.js


What is the right path for JsBarcode.all.min.js that should be given for the source to be used locally instead of downloading it from the Internet?

In ERPNext version 10 and version 11, it contains JsBarcode.all.min.js under the path: /home/frappe/frappe-bench/apps/frappe/frappe/public/js/lib$, I need to use it instead of downloading it from the link, so what is the right path that I have to give it in the following codes (in case of javascript or in the printing format):

Javascript Code:

$.getScript("/Path_to_the_JSBarcode_file/JsBarcode.all.min.js", function( data, textStatus, jqxhr ) {

Printing Format:

< svg class=“barcode”
jsbarcode-value="{{ doc.barcode}}"/>
< script src=“”>
< script>
< /script>

I tried to place this path: “public/js/lib/JsBarcode.all.min.js” but it is giving the 404 (NOT FOUND) error at the browser console.

Appreciate the kindly help from @fkardame and @Pawan because I found a topic about this in this link:

One note on this reference post:
Using the code the proposed from @Pawan, I am able to view the barcode at the image, but after refreshing, I do not see the barcode again, and really I do not know what is the benefit of using the code field type?

I think that @bkm also complained about the same problem (displaying the image but does not save).


I will have to login to your system and check your custom script that you are using to really comment on the issue you are having. I have personally used similar script for a customer and it is working fine. Also, the idea behind sharing a generic code snippet is that the user / developer / implementor puts in some effort to modify it according to their needs.

You are welcome via Team Viewer if you would.

Anyway, my problem that I need to know what is the right path to be given for getScript in the line:
$.getScript("/public/js/lib/JsBarcode.all.min.js", function( data, textStatus, jqxhr )

Because **/public/js/lib/JsBarcode.all.min.js** is wrong path and causing error in the browser.
But it is working if I placed this path:

The other problem that it is not saving the barcode as image (so once I reloaded the page after I saved, the barcode image disappear) as shown below:

And below is the custom fields that I added and its type:

So what I am missing to keep the barcode image appearing? I think something related to the code field which is barcode_svg and its related with the image field.

Really the location for the JsBarcode.all.min.js is the needed if possible please.


I got to know the right path, it should be:

So the path is taken from the sites directory, it is the home directory.


I have been trying to get this to work. Even placed it in the directory as instructed.

Also followed the procedure given here

Were you able to get barcode generation to work?

@danishaak I think it will help you this link

/home/Your User/User-bench/sites/assets/Your User/js/lib