title: Within babel traverse how do I throw an error with specific information about that line?
body: <p>I am looking to throw an error when traversing over parsed code using babel / babylon.</p>
  <p>I thought <code>path.buildCodeFrameError</code> would work, <a href="https://github.com/babel/babel/issues/8617" rel="nofollow noreferrer">but it does not work in traverse</a>.</p>
  <pre><code>  babelTraverse(nodes, {
      ImportDeclaration: (path) =&gt; { 
        modules.push(path.node.source.value)
      },
      CallExpression: (path) =&gt; {
        const module = getCallExpression(path.node, 'require')
        const variable = getVariable(path.container)
        if (VALID_LIBS.includes(module) &amp;&amp; !variable) {
          throw path.buildCodeFrameError(`&quot;${module} must have a variable assigment`)
        }
      }
    })
  </code></pre>