Npm error on command line: The system cannot find the path specified.

Posted by admin at May 30, 2020

I spent a whooping 5 hours researching an error that prevented me from completing npm dependent tools. I was getting two recurring errors:

> pub get failed (1; The system cannot find the path specified.)

proceeded by a bunch of these

> The system cannot find the path specified.

I initially figured the previous error was more important to sort out as I have seen several cases where the latter did not prevent my entry at the command line from running. Running packages or frameworks depending on Npm threw this error all the time but still completed nonetheless. Little did I know this time solving it would save me time.

Next I spent a long time researching the error and came up with nothing.

The history of errors

I was trying to setup an app directory for a Flutter app but kept getting the following

> flutter create bitPool
>The system cannot find the path specified.
Checking Dart SDK version…
& : The term 'C:\Users\user\AppData\Local\Temp_MEI178082\Scripts\conda.exe' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At C:\Users\user\Documents\WindowsPowerShell\profile.ps1:4 char:4(& "C:\Users\user\AppData\Local\Temp_MEI178082\Scripts\conda.exe" " …
(& "C:\Users\user\AppData\Local\Temp_MEI178082\Scripts\conda.exe" CategoryInfo : ObjectNotFound:
(C:\Users\user...ripts\conda.exe:String) [], CommandNotFoundException FullyQualifiedErrorId : CommandNotFoundException
Downloading Dart SDK from Flutter engine 51b818295a8969fa1b9c718dc93cb1ff142f8950…
Unzipping Dart SDK…
Building flutter tool…
Running pub upgrade…
The system cannot find the path specified.
Downloading Material fonts… 1.0s
Downloading Gradle Wrapper… 0.3s
Downloading package sky_engine… 0.6s
Downloading flutter_patched_sdk tools… 2.3s
Downloading flutter_patched_sdk_product tools… 2.1s
Downloading windows-x64 tools… 5.8s
Downloading windows-x64/font-subset tools… 0.9s

After several trials on the flutter CLI, I tried VSCode’s Flutter plugin and was able to create an app. However, trying to build and run the app threw similar errors:

> flutter run -d <device id>
> The system cannot find the path specified.
The system cannot find the path specified.
Downloading android-arm-profile/windows-x64 tools… 0.6s
Downloading android-arm-release/windows-x64 tools… 0.6s
Downloading android-arm64-profile/windows-x64 tools… 0.8s
Downloading android-arm64-release/windows-x64 tools… 0.8s
Downloading android-x64-profile/windows-x64 tools… 0.9s
Downloading android-x64-release/windows-x64 tools… 0.5s
The system cannot find the path specified.
The system cannot find the path specified.
Running "flutter pub get" in hello_app…
pub get failed (1; The system cannot find the path specified.)

Tried repairing flutter packages thinking there was an error with Dart’s packager – pub:

$ flutter packages get

… and still I get the following:

> The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
Running "flutter pub get" in hello_app…
pub get failed (1; The system cannot find the path specified.)

The solution

I paid closer attention to the last line

> pub get failed (1; The system cannot find the path specified.)

It was an error resulting from another error. pub get seems to be OK but is hampered by “a certain path specified”. A closer look at the error, revealed the details of this specified path:

> The system cannot find the path specified.
> : The term 'C:\Users\user\AppData\Local\Temp_MEI178082\Scripts\conda.exe' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At C:\Users\user\Documents\WindowsPowerShell\profile.ps1:4 char:4 (& "C:\Users\user\AppData\Local\Temp_MEI178082\Scripts\conda.exe" " … CategoryInfo : ObjectNotFound: (C:\Users\user...ripts\conda.exe:String) [], CommandNotFoundException FullyQualifiedErrorId : CommandNotFoundException

The text C:\Users\user\AppData\Local\Temp\ usually points to a folder that contains files for applications that are being installed or resulted in incomplete installation. “conda.exe” was a copy of a failed Anaconda Python installation. This must be a RegEdit problem.

I opened regedit, did a quick backup and searched for the path

> C:\Users\user\AppData\Local\Temp_MEI178082\Scripts\conda.exe

And the following location popped up

> HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

I opened this registry, found the path, removed it and saved. Problem solved. The errors disappeared and the Flutter app build completed successfully afterwards.

   0 likes

Suggested Read