I am trying to change the default folder in node.js. I went to the following link in the node.js documentation: https://nodejs.org/api/process.html#process_process_chdir_directory
I then generated the following code in a .js file:
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}');
}
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?
I am trying to change the default from C:/Windows/System32/ to what I have above. Any help would be much appreciated.