Skip to content
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

Doctor complains when installation is not global #52

Open
dfee opened this issue May 6, 2020 · 2 comments
Open

Doctor complains when installation is not global #52

dfee opened this issue May 6, 2020 · 2 comments

Comments

@dfee
Copy link

dfee commented May 6, 2020

I want to install yeoman in my monorepo project... and wrap it as part of another tool (that registers the package elsewhere in the monorepo). however, this seems to annoy the doctor:

Yeoman Doctor
Running sanity checks on your system

✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✖ NODE_PATH matches the npm root

Unable to find the npm root, something went wrong.
Try to execute npm -g root --silent on your command-line

✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
✔ yo version

Found potential issues on your machine :(
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 684 packages from 392 contributors and audited 4310 packages in 18.171s

19 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Is this verify necessary / useful? Can it be updated to support non-global installs?

exports.verify = async () => {
if (process.env.NODE_PATH === undefined) {
return null;
}
const nodePaths = (process.env.NODE_PATH || '').split(path.delimiter).map(fixPath);
try {
const stdout = childProcess.execSync('npm -g root --silent');
const npmRoot = fixPath(stdout);
if (nodePaths.indexOf(npmRoot) < 0) {
return errors.pathMismatch(npmRoot);
}
return null;
} catch (error) {
return errors.npmFailure();
}
};

@SBoudrias
Copy link
Member

It's useful for most users as it usually point to misconfigurations.

These are just warning, feel free to ignore if you know you have a special setup that is working fine.

@mshima
Copy link
Member

mshima commented May 7, 2020

@dfee if you are doing some custom lookups, you can consider using yeoman-environment directly.
AFAIC yo is a stand-alone cli and yeoman-doctor is an yo utility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants