question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid path with leading 'null' on Windows 10

See original GitHub issue

Latest version 23 creates invalid paths with leading null\ on Window 10.

I encountered this when updating SBT / coursier and dependencies where downloaded to a null dir inside my project.

Actual

import dev.dirs.ProjectDirectories
import $dep.`dev.dirs:directories:23`

ProjectDirectories.from("org", "scalameta", "metals")
// res0: ProjectDirectories = ProjectDirectories (Windows 10):
//   projectPath   = 'scalameta\metals'
//   cacheDir      = 'null\scalameta\metals\cache'
//   configDir     = 'null\scalameta\metals\config'
//   dataDir       = 'null\scalameta\metals\data'
//   dataLocalDir  = 'null\scalameta\metals\data'
//   preferenceDir = 'null\scalameta\metals\config'
//   runtimeDir    = 'null'

Expected

import dev.dirs.ProjectDirectories
import $dep.`dev.dirs:directories:22`

ProjectDirectories.from("org", "scalameta", "metals")
// res0: ProjectDirectories = ProjectDirectories (Windows 10):
//   projectPath   = 'scalameta\metals'
//   cacheDir      = 'C:\Users\user\AppData\Local\scalameta\metals\cache'
//   configDir     = 'C:\Users\user\AppData\Roaming\scalameta\metals\config'
//   dataDir       = 'C:\Users\user\AppData\Roaming\scalameta\metals\data'
//   dataLocalDir  = 'C:\Users\user\AppData\Local\scalameta\metals\data'
//   preferenceDir = 'C:\Users\user\AppData\Roaming\scalameta\metals\config'
//   runtimeDir    = 'null'

Environment

OS: Windows 10 1903 JVM: AdoptOpenJDK 1.8.0_222 / 1.8.0_282

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fthomascommented, Feb 3, 2021

Trying without -version 2 if Powershell fails sounds sensible to me but I would probably not check the error message because it is localized.

Btw, has somebody tried using JNA instead of shelling out to Powershell. Maybe that is easier than fighting Powershell.

0reactions
soccommented, Mar 22, 2021

Thanks @snlykf and @nartamonov for checking, and thanks to @phongngtuan for fixing it!

Closing this, let me know if you experience this again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

github/git Checkout Returns 'error: invalid path' on Windows
After researching the error, I've found 2 possible answers: 1) Change the path on the repository file. Unfortunately, this is is a team...
Read more >
Windows Invalid path error - Microsoft Community
Windows 10 Home 64 bit. When windows starts a small window opens with the message 'Invalid Path: D:\Top\' What's happening?
Read more >
11 Ways to Fix "The System Cannot Find The Path Specified ...
11 Ways to Fix "The System Cannot Find The Path Specified" Error on Windows · 1. Run Command Prompt as an Administrator ·...
Read more >
Fix Windows errors that occur during Acrobat Reader update
Fix the Microsoft Windows errors that occur when updating Adobe Acrobat ... 1324, Volume invalid or the path contains an invalid character ...
Read more >
Fix JAVA_HOME errors | Invalid directory | Not set or defined
And, it also tells you it's not pointing to the right place, which is helpful as well. All you need to do to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found