-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
Documentation not up-to-date for "Install actions" #1294
Comments
How is that best to be solved now? I urgently need an |
Okay, I saw that it then installed automatically. It reports that no standard package manager has been stored and that it uses npm. How can you fix a package manager like yarn here? In principle, can the install method also be viewed as deprecated? The TypeScript Type Definitions would also have to be adapted. Here npmInstall methods etc. are also offered. |
According to the 5.0.0 changelog there should be a way to access: this.addDependencies({lit: '2.0.0'}) |
Background about this change: #1283. Force yarn using cli: Force yarn inside a generator: |
We have created a generator that is supposed to create a new project directory with package.json. Only npm install will then not be executed automatically. Only if the package.json is created in the current directory where the generator is being executed. We tried Although it shows during the debug that it has found the package.json, no installation is started. Please urgently need a solution. This is the generator: |
In that case you should set the environment cwd Lines 127 to 128 in 84551ee
Something like:
Edit: |
We use npm :) Thanks for your help! |
@GregorBiswanger the definitions were updated a few hours ago |
@mshima Unfortunately the cwd assignment does not work. He then runs
|
Any update on this? I can't, for the life of me, find a way to configure And also, I just cannot find a way to disable the unchanged |
Downgrading |
@phatpham9: Are you suggesting to specifically use |
yeah if you want to force it to use npm, just replace the value with 'npm' updated: don't forget to remove the |
Hello, I'm having the same issue like everybody here... Is there a way to trigger the installation of the packages manually? |
Did this to get the old install behaviour back:
Hopefully it will also be available in future releases until a more complete version of |
@alexandra-c downgrading to the previous major version worked for me, with everything working as expected. |
An additional information. |
import { exec } from 'child_process'; |
Now that we are missing the |
@mshima This is not quite minimal, but this branch of my generator has the problem: https://github.com/jwalton/node-jwalton-generator-typescript/tree/upgrade-yeoman In my case, if you try to create a module with the same name as the current folder, I write it to the current folder, and it does the default() {
if (path.basename(this.destinationPath()) !== this.props.githubProjectName) {
this.log(`Creating folder ${this.props.githubProjectName}.`);
mkdirp(this.props.githubProjectName);
this.destinationRoot(this.destinationPath(this.props.githubProjectName));
} else {
this.log(`Not creating folder ${this.props.githubProjectName}.`);
}
} And in this case I get the |
I agree with @alexandra-c - this seems like an arbitrary set back to the api. But even worse - is the only way to figure out how things are working anymore is to read the actual code... Even the JSDoc is wrong/outdated. @mshima - while your work is appreciated, and I know documentation is pain...this is a heavily depended upon package and changes affect a lot of people. Do you think you could at least possibly find the time to update the JSDoc with all the code and API changes so that users aren't completely left hanging out to dry? EDIT: Upon further looking and digging, it is documented in the changelog- for anyone else wondering. |
I ran into this today while trying to install packages where I need to pass options. It's unclear, with the automatic install, how to set options. Specifically, in my case, I want to omit some peer dependencies using npm 7 and need to pass a flag at install to To give an example of what I mean. Package A:
Packages B and C are separate tools that invoke package A but package A never actually uses them. The user can choose to either bring in package B or C to execute package A - but they do not need both. With npm 7 dependency resolution changes so that peerDependencies that are not satisfied are brought in by default. This wouldn't be an issue except package B and C are very large and due to size limitations we can only fit B or C but not both. Automatic install is fine. But it would be nice to have a way documented to set extra options during the npm install for this case and any others that need install flags / args. |
Npm is executed once and you can customize it. |
Stitching bits and pieces of this thread together I was able to create a workaround:
Overall though I agree with the sentiment that this is a behavioral regression. Being able to manage packages programmatically through yeoman is a potentially nice feature, but we shouldn't be forced to do it. If I just want to list all of the dependencies in the template file it shouldn't be hard to just install them once. |
The current Yeoman generator version 5.6.x, while ours was. 3.1.x. However, version 5 introduced breaking changes regarding npm package management. Attempts to migrate to this new API failed as it is very different, poorly documented and possibly broken. See yeoman/generator#1294 Therefore migrate to latest 4.x only. It works out of the box.
The current Yeoman generator version is 5.6.x, while ours was 3.1.x. However, version 5 introduced breaking changes regarding npm package management. Attempts to migrate to this new API failed as it is very different, poorly documented and possibly broken. See yeoman/generator#1294 Therefore migrate to latest 4.x only. It works out of the box.
see yeoman/generator#1294 yo@5 is still not handling this well
Since version 5.0.0 the Install action is deprecated and is not included by default to the generator instance. This is currently not documented/reflected in here:
The text was updated successfully, but these errors were encountered: