Comments (10)
So forgive me for not understanding a thing about Windows, but this would seem to indicate that pub
is not in your PATH. What happens when you run pub get
from the command line by itself?
from aqueduct.
pub is in my PATH and it works fine, but it seems that the "aqueduct create" fails to switch directory before making the pub get command.
from aqueduct.
So, it must be here: https://github.com/stablekernel/aqueduct/blob/master/lib/commands/template_creator.dart#L75
The template generator works by creating a directory and putting a pubspec.yaml file in that directory. Then it runs pub get to fetch the entire package, which contains the templates. Then it effectively copies over the template contents to that directory. It's either having problems with setting the CWD to the project directory, or finding the pubspec.yaml file in the project directory.
Would you be able to step through the template generator code on your machine? If you instead clone this repository and reactive aqueduct to point at the local installation (pub global activate -s path path/to/aqueduct
), you should be able to dig into the state of the filesystem at this point.
from aqueduct.
Yeah it seems the problem come from this line :
var result = Process.runSync("pub", ["get", "--no-packages-dir"], workingDirectory: projectDirectory.path);
in template_creator.dart.
I tried to do somehing with a minimal code and it failed with the same error.
import 'dart:io';
main () {
var result = Process.runSync("dir", []);
if (result.exitCode != 0) {
throw new Exception("${result.stderr}");
}
}
("dir" command is equivalent to "ls" on linux)
It's as if the "Process.runSync" method doesn't use the PATH on windows.
I think it's a dart problem, not an aqueduct one.
from aqueduct.
When I add the "runInShell: true" parameter its seems to work but I dont know why it works like this on windows...
from aqueduct.
Can you also try includeParentEnvironment = true (with runInShell = false)? I wonder if the PATH doesn't get inherited on Windows, and runInShell runs detached in some way so that it does?
from aqueduct.
Oh nvm, that is already true by default. I'll check to see if runInShell creates issues on macOS and if it doesn't, I'll simply add that to the script.
from aqueduct.
@aelayeb Would you be able to clone this repo with branch jc/runinshell, then install that as your global aqueduct (pub global activate -spath /path/to/local/
) and see if the project creation script works? And potentially the setup script as well?
from aqueduct.
For the "PATH" problem it's good !
Now I have another error :
C:\Users\Jin>aqueduct create -n web_dart
Fetching Aqueduct as:
aqueduct: "any"
Determining Aqueduct template source...
Using template source from: /C:/Users/Jin/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/aqueduct-1.0.1.
FileSystemException: Exists failed, path = '/C:/Users/Jin/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/aqueduct-1.0.1/example/templates/default'
(OS Error: La syntaxe du nom de fichier, de r├®pertoire ou de volume est incorrecte.
, errno = 123)
The error says "File, directory or drive name syntax is incorrect" (in french).
I think it's because of the first slash in the directory path.
In Windows there is no things such as the "root" filesystem.
Every drives is mounted with a letter which gives path starting by thoses letters.
The incorrect path comes probably from the package uri resolver I think : https://github.com/stablekernel/aqueduct/blob/jc/runinshell/lib/commands/template_creator.dart#L81
I'll try to figure out what's causing this.
from aqueduct.
I made a PR against your branch which solve the issue on Windows : #111
I don't have a macOS, so if you can try on your side if everything is OK ?
from aqueduct.
Related Issues (20)
- How to use ORM without http server HOT 1
- starting from existing db HOT 2
- Getting Socket exception after restarting the aqueduct app HOT 4
- Problems with aqueduct commands after flutter upgrade HOT 12
- How to install aqueduct on macOS? HOT 4
- How to I change aqueduct serve default port? HOT 5
- How can I create a push notification with aqueduct? HOT 2
- Unable to create project. HOT 1
- aqueduct db upgrade gives range error : Invalid value: Not in inclusive range 0..1114111: -1 HOT 2
- I think aqueduct need provide object transfer method like the AutoMapper
- [Feature request !!] any plans to return html templates instead of json ? HOT 1
- Dart 2.12 and new features HOT 1
- Use multiple query condition after join
- Dependency issues, new versions of googleapis are no longer compatible
- null-safety error on commands HOT 3
- Feature-Request: Replace mirrors with reflectable
- Here's how to fix your Heroku app (SSL) HOT 2
- Annotation @ManagedTableAttributes: Is not working. HOT 1
- Is this project no longer maintained
- Do you consider adding such a plug-in, please see the link below!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aqueduct.