Skip to content

yo unable to find generators installed with pnpm #693

@phishbacon

Description

@phishbacon

I was trying to use yo and generator-office installed via pnpm.
This line below resolves to the global/*/node_modules which is not an actual directory.

if (process.env.PNPM_HOME) {
paths.push(resolve(process.env.PNPM_HOME, 'global/*/node_modules'));
}

When attempting to find modules in global/*/node_modules this existsSync(root) fails.
export function findPackagesIn(searchPaths: string[], packagePatterns: string[], globbyOptions?: any): any[] {
searchPaths = arrify(searchPaths)
.filter(Boolean)
.map(npmPath => resolve(npmPath));
let modules: any[] = [];
for (const root of searchPaths) {
if (!existsSync(root) || (!lstatSync(root).isDirectory() && !lstatSync(root).isSymbolicLink())) {
continue;
}

The result when using yo is this with generator-office installed globally with pnpm is this.

Error office

You don't seem to have a generator with the name “generator-office” installed.
But help is on the way:

You can see available generators via npm search yeoman-generator or via http://yeoman.io/generators/.
Install them with npm install generator-office.

To see all your installed generators run yo --generators. Adding the --help option will also show subgenerators.

If yo cannot find the generator, run yo doctor to troubleshoot your system.

pr to fix here #692

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions