error compiling arduino shiftout example

Hello, I am new here, I am receiving an error every time I try to compile the shiftout example copy and pasted from the arduino website for aduino nano (the same error comes up for other boards I have tried). The error does not seem to give much of a hint to what is actually wrong. I have posted the code and error bellow. Note this is not a problem with the board as this problem also exists when I press compile.

Error:

Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino Nano, ATmega328P"

readlink C:\Users\danie\OneDrive\Documents\ArduinoData\packages: The system cannot find the file specified.

Error compiling for board Arduino Nano.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Code:

int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;

void setup() {
  //set pins to output because they are addressed in the main loop
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
  //count up routine
  for (int j = 0; j < 256; j++) {
    //ground latchPin and hold low for as long as you are transmitting
    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, j);
    //return the latch pin high to signal chip that it
    //no longer needs to listen for information
    digitalWrite(latchPin, HIGH);
    delay(1000);
  }
}

The problem is caused by using the Arduino IDE with files located under the OneDrive folder.

The easiest solution is to not use the Arduino IDE with any files in OneDrive.

In this case that's a little tricky because the Windows App Store version of the Arduino IDE is storing
files under C:\Users\danie\OneDrive\Documents\ArduinoData. You can avoid this by using either the "Windows ZIP file for non admin install" or "Windows Installer, for Windows XP and up" downloads from https://www.arduino.cc/en/Main/Software instead of the Windows App Store version of the Arduino IDE.

If you also you have your sketchbook located under OneDrive you can change the location of the sketchbook folder via the Arduino IDE's File > Preferences > Sketchbook Location. Change that setting to any convenient folder on your computer as long as it's not in the OneDrive. The Arduino IDE does not automatically copy the contents of the previous sketchbook folder to the new location so you will need to do this manually.

If you do want to continue using the Arduino IDE with OneDrive, you may be interested to know that the bug has already been fixed in the beta build of the Arduino IDE, which you can download here:

but be aware that version of the Arduino IDE is primarily intended only for beta testing so you may have a higher chance of encountering bugs than you would using the production releases of the IDE.

To see details on the problem, steps that are being taken to fix it, and other possible workarounds that will allow you use the Arduino IDE with OneDrive, see:

If you also you have your sketchbook located under OneDrive you can change the location of the sketchbook folder via the Arduino IDE's File > Preferences > Sketchbook Location. Change that setting to any convenient folder on your computer as long as it's not in the OneDrive. The Arduino IDE does not automatically copy the contents of the previous sketchbook folder to the new location so you will need to do this manually.

that worked, thanks