-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(dependencies) add gulp and typescript to the dependencies #803
Conversation
@JeroenVinke any chance we can get this merged? |
I'd like to discuss this a bit. I might be overlooking something, but without having typescript and gulp installed (globally) I can run a new typescript app. Gulp and typescript are getting installed locally which seems to be enough. That said, I have seen those errors before ( Could you explain the specifics of the post install task that you're using? Perhaps we can get to the root cause of this |
@JeroenVinke I can. TL;DR: I don't install the aurelia-cli to the aurelia-project, but instead install it in a folder further up, and then link it to the node_modules of the aurelia-project, therefore making the aurelia-cli unable to find the correct gulp-version, because it is not installed alongside the aurelia-cli, because it is not listed in its dependencies. Detailed version: We have a modular project that consists of about 70 repositories. To manage all of them we have one repository that uses meta and minstall to clone, install, link and build all these 70 repositories so that a developer can change something in one of these locally cloned folders and have the change take effect in our application. This meta-repository is (in other words) the developer-setup for our modular application. One of these 70 repositories is an aurelia-application, which is the only one that can't be built after the dependency-installation through minstall. The reason for that is, that in order to save (a lot) of time, minstall hoists the dependencies as far up as possible without creating conflicts. It also installes every dependency only once per conflicting version. The result is, that every dependency of every of these 70 modules is installed at least once somewhere: Either in the meta-repo-folder itself, or in one of the module-folders. After the installation phase, minstall checks what dependencies are installed where, and what dependencies are required where, and links them accordingly. The result is, that every one of these modules has at the very least a node_modules folder, where all its dependecies are linked into. What happens now with the aurelia-project is, that the aurelia-cli is not installed to the node_modules-folder of the aurelia-project, but to the node_modules of the meta-repo-folder, and then linked from there to the aurelia-project-node_modules. Because of that, the npm-commands in our package.json here see an aurelia-cli in their local node_modules, use that, but because that aurelia-cli is actually in a different folder, that aurelia-cli is not using the gulp-version of our aurelia-project, but some other gulp-version that just happened to be installed to the meta-repo-node_modules. If the aurelia-cli would explicitly state that it requires these dependencies to work, then installing it to a different folder and then linking it wouldn't be a problem, because the |
Thank you for the detailed description. I'll need to give this some thought |
closes aurelia#801 supesedes aurelia#803
let's do it. I've opened #857 which has a couple of additional changes |
the aurelia-cli cannot be used in its entirety without having
gulp@^4.0.0
andtypescript
installed. The aurelia-cli depends on them at least at these places duringau build
:gulp (fails with
Error: Cannot find module 'gulp'
)cli/lib/commands/gulp.js
Line 19 in ceb7860
gulp@^4.0.0 (fails with
TypeError: Cannot read property 'apply' of undefined
)cli/lib/commands/gulp.js
Line 72 in ceb7860
typescript (fails with
Error: Cannot find module 'typescript'
)cli/lib/project.js
Line 221 in ceb7860
The dependencies of the package.json should reflect, that the aurelia-cli requires these dependencies to be used. This is what is implemented in this branch.
This fixes #801