title: Vue Error - Can't resolve 'https' when importing package
body: <p>I'm trying to make a Vue project and use an npm package for connecting to the retroachievements.org api to fetch some data, but I'm getting an error. Here's my process from start to finish to create the project and implement the package.</p>
  <ul>
  <li><p>Navigate to my projects folder and use the vue cli to create the project: <code>vue create test</code>. For options, I usually chose not to include the linter, vue version 2, and put everything in package.json.</p>
  </li>
  <li><p>cd into the /test folder: <code>cd test</code> and install the retroachievements npm package: <code>npm install --save raapijs</code></p>
  </li>
  <li><p>Modify App.vue to the following (apologies for code formatting, not sure why the post isn't formatting/coloring it all properly...):</p>
  <p>const RaApi = require('raapijs');</p>
  <p>export default {
  name: 'App',</p>
  <pre><code>  data: () =&gt; ({
        api:null,
        user: '&lt;USER_NAME&gt;',
        apiKey: '&lt;API_KEY&gt;',
    }),
  
    created() {
        this.api = new RaApi(this.user, this.apiKey);
    },
  </code></pre>
  <p>}</p>
  </li>
  <li><p>run `npm run serve' and get the error:</p>
  <p>ERROR in ./node_modules/raapijs/index.js 2:14-30</p>
  <p>Module not found: Error: Can't resolve 'https' in 'C:\Projects\Web\test\node_modules\raapijs'</p>
  </li>
  </ul>
  <p>I'm on Windows 10, Node 16.17.0, npm 8.15.0, vue 2.6.14, vue CLI 5.0.8, raapijs 0.1.2.</p>
  <p>The first solution below says he can run it without error but it looks like the exact same code as I'm trying. Can anyone see a difference and a reason for this error?</p>
  <p>EDIT: I reworded this post to be more clear about my process and provide more info, like the versions.</p>