Vuejs require("axios") in .js file, require is not defined [duplicate]

Solution 1:

This happens because require() doesn't exist on browser/client-side JavaScript.

You need to import Axios using the <script> tag and then you will be able to use it.