Open syedsohanahmed opened 3 years ago
@syedsohanahmed Which dart version do you use?
I have the same error, using Dart SDK version: 2.10.2 (stable) (Tue Oct 13 15:50:27 2020 +0200) on "linux_x64"
@jayjah I am using Dart SDK version: 2.10.2 (stable) (Tue Oct 13 15:50:27 2020 +0200) on "windows_x64"
Actually I am on "macosx" and aqueduct with 3.3.0+1 and pre-release version is working fine. Do you experience the same behaviour with the pre-release version?
pub global activate aqueduct 4.0.0-b1
The actual problem is the following: Aqueduct tries to get a reference of the global aqueduct package, which was installed with the above command. Obviously it can't find that one and throws an error. It seems that somehow your environment variables are misleading. The package that makes the mistake is this one: Pub_Cache and moreover this issue seems to be related to your problem as well: Pub_Cache Issue.
You could debug your global dart packages with the Pub_Cache package and I guess you'll find the problem anywhere there.
@jayjah
Thanks a lot, the problem has been solved to use the command pub global activate aqueduct 4.0.0-b1
@Prn-Ice
@syedsohanahmed Glad to hear! Cheers up!
pub global activate aqueduct 4.0.0-b1
seems useless
@arcticfox1919
Please check my previous post.
The actual problem is the following: Aqueduct tries to get a reference of the global aqueduct package, which was installed with the above command. Obviously it can't find that one and throws an error. It seems that somehow your environment variables are misleading. The package that makes the mistake is this one: Pub_Cache and moreover this issue seems to be related to your problem as well: Pub_Cache Issue.
You could debug your global dart packages with the Pub_Cache package and I guess you'll find the problem anywhere there.
@jayjah Thanks for your reply, I have solved the problem.It is indeed a problem with Pub_Cache
Need to configure a global environment variable on the windows platform:
PUB_CACHE=%LOCALAPPDATA%\Pub\Cache
after writing this command
pub global activate aqueduct 4.0.0-b1
Appeared this issue
after writing this command pub global activate aqueduct 4.0.0-b1 Appeared this issue
Same any solution ?
@MouhibAgrebi
Have you added PUB_CACHE to environment variables? Since I added it, It works fine.
PUB_CACHE C:\src\flutter.pub-cache (I use flutter) If you dont use flutter and installed dart sdk, check user's appdata folder. There should be pub and cache folder. ensure restart your system if you added it to user variables.
@MouhibAgrebi
Have you added PUB_CACHE to environment variables? Since I added it, It works fine.
PUB_CACHE C:\src\flutter.pub-cache (I use flutter) If you dont use flutter and installed dart sdk, check user's appdata folder. There should be pub and cache folder. ensure restart your system if you added it to user variables. @bumpsoo063 no, how i can add it ?
@MouhibAgrebi
Have you added PUB_CACHE to environment variables? Since I added it, It works fine.
PUB_CACHE C:\src\flutter.pub-cache (I use flutter) If you dont use flutter and installed dart sdk, check user's appdata folder. There should be pub and cache folder. ensure restart your system if you added it to user variables.
@MouhibAgrebi oh sorry I misunderstood your comments. Have your activated stable aqueduct? not the one pre-release(4.0.0-b1). Was there the same error when activating? or did you get an error when creating a aqueduct project? If you had no problems with activating stable version and had a problem when creating it. The way in my comment should solve. And to set environment variables. press window in your keyboard and search environment variable. you can find details by searching.
Anyway I got the error you're getting when I was activating angel-dart. Probably Its because There is not lib/analyzer.dart in newer analyzer package.
you can reference this guy's issue solution
I am facing this issue to create a aqueduct project
-- Aqueduct CLI Version: 3.3.0+1 * Uncaught error Bad state: No element ** Stacktrace
0 ListMixin.firstWhere (dart:collection/list.dart:167:5)
1 CLIAqueductGlobal.aqueductPackageRef (package:aqueduct/src/cli/commands/create.dart:342:10)
2 CLIAqueductGlobal.templateDirectory (package:aqueduct/src/cli/commands/create.dart:347:12)
3 CLIAqueductGlobal.getTemplateLocation (package:aqueduct/src/cli/commands/create.dart:351:12)
4 CLITemplateCreator.handle (package:aqueduct/src/cli/commands/create.dart:51:27)
5 CLICommand.process (package:aqueduct/src/cli/command.dart:159:20)
6 CLICommand.process (package:aqueduct/src/cli/command.dart:135:12)
7 main (file:///C:/Users/Syed%20Sohan%20Ahmed/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/aqueduct-3.3.0+1/bin/aqueduct.dart:9:27)
8 _startIsolate. (dart:isolate-patch/isolate_patch.dart:299:32)
9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)