title: How to Change Default Directory in Node.JS
body: <p>I am trying to change the default folder in node.js. I went to the following link in the node.js documentation:
  <a href="https://nodejs.org/api/process.html#process_process_chdir_directory" rel="nofollow noreferrer">https://nodejs.org/api/process.html#process_process_chdir_directory</a></p>
  
  <p>I then generated the following code in a .js file:</p>
  
  <pre><code>console.log('Starting directory: ${process.cwd()}');
  try {
    process.chdir('C:\Users\HalvorSD\node-party');
    console.log('New directory: ${process.cwd()}');
  } catch (err) {
    console.error('chdir: ${err}');
  }
  </code></pre>
  
  <p>I get the error thrown in my console. The directory does exist so that's not the problem. Is my directory formatting incorrect or what's my issue?</p>
  
  <p>I am trying to change the default from C:/Windows/System32/ to what I have above. Any help would be much appreciated.</p>