Arduino Nano acting strainge when disconnecting from PC

Plus of led strip to 12V, minus of led strip to collector of TIP120. Emitter of TIP120 to ground. Base of TIP120 via a resistor to pin of Arduino.

You will need to calculate the resistor; a guide can be that the current through the resistor needs to be approximately 10% of the current that the strip draws. The current through the resistor may not exceed 20mA (the safe current that a pin of the microcontroller can deliver).

Note that transistors in this application can run very hot; it's better to use logic level fets. In that case you do not need to calculate the resistor, just use the value that was shown in e.g. the article that I linked.