Linking wp_enqueue can’t find the javascript file (adds “?ver=x.x.x” to the src)

console.log() is a JavaScript function. You cannot use it in PHP. Add that to your JavaScripts.

The version parameter should not affect the file access. But you can remove that parameter and see if it works then. If it does, your server configuration needs further inspection, because it should also work with the version.