title: "ERR_ABORTED 404 (Not Found)" and "its MIME type ('text/html') is not executable, and strict MIME type checking is enabled" in console
body: <p>I'm relatively new at web development and in the phase where you do as many projects as you can for practice. I have a simple website for my profile and two script tags at the bottom of my index page right before the closing body tag.</p>
  
  <pre><code>&lt;script type="text/javascript" src="js/scroll.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js/app.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>They are kept in a folder called "js" and have the .js type. The app.js has my js for a contact form and the scroll.js is empty for now.</p>
  
  <p>I get a bunch of errors in the console in Chrome:</p>
  
  <pre><code>GET http://localhost:3000/js/scroll.js net::ERR_ABORTED 404 (Not Found)
  localhost/:127 GET http://localhost:3000/js/app.js net::ERR_ABORTED 404 (Not Found)
  localhost/:126 GET http://localhost:3000/js/scroll.js net::ERR_ABORTED 404 (Not Found)
  :3000/#about:1 Refused to execute script from 'http://localhost:3000/js/scroll.js' 
  because its MIME type ('text/html') is not executable, and strict MIME type checking is 
  enabled.
  localhost/:127 GET http://localhost:3000/js/app.js net::ERR_ABORTED 404 (Not Found)
  :3000/#about:1 Refused to execute script from 'http://localhost:3000/js/app.js' because 
  its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
  </code></pre>
  
  <p>I would really appreciate any help. This is also my first time asking a question here so thanks for your patience.</p>
  
  <p>UPDATE:
  Thank you ll for your help - I learned a lot. I'm having a related issue now. I moved app.js and scroll.js to the correct folder and got it, however now everyday I try to run the server, it seems to be going to the wrong directory.</p>
  
  <p>ex:Failed to lookup view "contact" in views directory "C:\Users\eh653\desktop\profile\public" then the next day Failed to lookup view "contact" in views directory "C:\Users\eh653\desktop\profile\public\views". </p>
  
  <p>Here is my app.js:</p>
  
  <pre><code>const express = require('express');
  const bodyParser = require('body-parser');
  const exphbs = require('express-handlebars');
  const path = require('path');
  const nodemailer = require('nodemailer');
  
  const app = express();
  
  // View engine setup
  app.engine('handlebars', exphbs());
  app.set('view engine', 'handlebars');
  
  // Static folder
  app.use('/public', express.static(path.join(__dirname, 'public')));
  
  // Body Parser Middleware
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());
  
  app.get('/', (req, res) =&gt; {
  res.render('contact');
  });
  
  app.post('/send', (req, res) =&gt; {
  const output = `
  &lt;p&gt;You have a new contact request&lt;/p&gt;
  &lt;h3&gt;Contact Details&lt;/h3&gt;
  &lt;ul&gt;  
    &lt;li&gt;Name: ${req.body.name}&lt;/li&gt;
    &lt;li&gt;Company: ${req.body.company}&lt;/li&gt;
    &lt;li&gt;Email: ${req.body.email}&lt;/li&gt;
    &lt;li&gt;Phone: ${req.body.phone}&lt;/li&gt;
  &lt;/ul&gt;
  &lt;h3&gt;Message&lt;/h3&gt;
  &lt;p&gt;${req.body.message}&lt;/p&gt;
  </code></pre>
  
  <p>`;</p>
  
  <pre><code>// create reusable transporter object using the default SMTP transport
  let transporter = nodemailer.createTransport({
      host: 'mail.host.com', 
      port: 465,
      secure: true, // true for 465, false for other ports
      auth: {
          user: 'example@example.com', // generated ethereal user
          pass: 'password'  // generated ethereal password
      },
      tls: {
          rejectUnauthorized: false
      }
  });
  
  // setup email data with unicode symbols
  let mailOptions = {
      from: '"Emily Hickey" &lt;info@emilyrhickey.com&gt;', // sender address
      to: 'emilyrhickey89@gmail.com', // list of receivers
      subject: 'Node Contact Request', // Subject line
      text: 'Hello world?', // plain text body
      html: output // html body
  };
  
  // send mail with defined transport object
  transporter.sendMail(mailOptions, (error, info) =&gt; {
      if (error) {
          return console.log(error);
      }
      console.log('Message sent: %s', info.messageId);
      console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));
  
      res.render('contact', { msg: 'Email has been sent' });
  });
  });
  
  app.listen(3000, () =&gt; console.log('Server started...'));
  </code></pre>
  
  <p>I'm not sure why it keeps changing each day to another folder. Again, thanks for any help.</p>