Tushar Kulkarni
Tushar Kulkarni

Reputation: 148

Flutter pub get running in wrong directory?

I created a new flutter project using flutter create. The path to pubspec.yaml is D:\dev\flutter\example\

But when I run flutter run in my projects, it gives an error: pubspec.yaml not found in D:\dev\flutter\

Why is flutter pub get running in the parent directory of my project?

Upvotes: 1

Views: 1772

Answers (3)

Tushar Kulkarni
Tushar Kulkarni

Reputation: 148

I solved it. my bad i didnt look at my pubspec which contained

dependencies:
  flutter:
    sdk: flutter
  responsive_framework:
    path: ../

the 'path' was causing it to run pub get in parent directory.

Upvotes: 1

wahid anvary
wahid anvary

Reputation: 398

Go to your project directory by:

cd D:\dev\flutter\example

Then run:

flutter clean
flutter run

Upvotes: 0

Shradha
Shradha

Reputation: 2452

Move to the folder you have recently created-

cd example

Then run "flutter run" from that folder.

Upvotes: 0

Related Questions