Giter VIP home page Giter VIP logo

doctor's Introduction

Welcome, Friend!

Yeoman is a robust and opinionated set of tools, libraries, and a workflow that can help developers quickly build beautiful, compelling web apps.

image

Code of Conduct

Everyone in this community (from core members to random committers and volunteers) are asked to please act in accordance with the Yeoman Community Contributor Code of Conduct. We encourage you to follow these social rules which help guide our interactions with each other, and ensure we provide a safe environment for everyone. We aim to make Yeoman a positive, welcoming, open and inclusive project and community.

Code of Conduct

Issue Submission

Make sure you've read the issue submission guidelines before you open a new issue.

Yeoman is composed of a number of different sub-projects, most of which have their own dedicated repository. If you are looking for a repo for a particular piece, you'll find it on the organization page.

Feature requests

Feature requests should be submitted to the repo it concerns. Submit to yeoman/yeoman if you're unsure, otherwise the repositories for our officially maintained generators can be found here.

Contribute

See the contributing docs

Support

Need help or have a question?

Please don't use the issue trackers for support/questions.

Links

Team

Yeoman is beautifully crafted by these people and a bunch of awesome contributors

Addy Osmani Sindre Sorhus Pascal Hartig Stephen Sawchuk Simon Boudrias
Addy Osmani Sindre Sorhus Pascal Hartig Stephen Sawchuk Simon Boudrias
Brian Ford Eddie Monge Paul Irish Hemanth.HM Revath S Kumar
Brian Ford Eddie Monge Paul Irish Hemanth.HM Revath S Kumar
Jimmy Moon Frederick Ros Mickael Daniel Eric Bidelman Matija Marohnić
Jimmy Moon Frederick Ros Mickael Daniel Eric Bidelman Matija Marohnić
Kevin Mårtensson Arthur Verschaeve Michael Kühnel Mehdy Dara Ulises Gascon
Kevin Mårtensson Arthur Verschaeve Michael Kühnel Mehdy Dara Ulises Gascon

Backers

Love Yeoman work and community? Help us keep it alive by donating funds to cover project expenses!
[Become a backer]

License

BSD license Copyright (c) Google

doctor's People

Contributors

afoxman avatar arthurvr avatar greenkeeper[bot] avatar hemanth avatar j3lte avatar kevva avatar litomore avatar logicer16 avatar mshima avatar ondblclick avatar rgroothuijsen avatar sboudrias avatar sindresorhus avatar stefanbuck avatar toru-tanaka avatar tremblaysimon avatar wtgtybhertgeghgtwtg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doctor's Issues

Less Threatening Node Version Potential Issue Message

If you install yo on Node 0.10.x (which meets the requirements in yo's package.json), you get the following warning from yodoctor:

✖ Node.js version

Your Node.js version is outdated.
Upgrade to the latest version: https://nodejs.org
...

Found potential issues on your machine :(

Either this "warning" seems a little more severe than it is (I believe this to be the case), or if this is really gonna cause issues (running on 0.10.x), yo needs to be more clear on what version(s) of Node it can run on.

If perhaps, it still runs fine on 0.10.x, but you're just suggesting to update, the message could better reflect that:

⚠ Node.js version

Your Node.js version is outdated. Yeoman will work on this version of Node.js, but [insert reasons (speed, security, 3rd party module support), etc here].
Upgrade to the latest version: https://nodejs.org
...

(omit "Found potential issues" message if this is the only issue)

warn when a generator is found with no default defined

it has been a while since i've built a new generator, so i overlooked the requirement to name the sub-generator that is intended to be the default, even if it is the only sub-generator, as app. i burned several evenings trying to sort out why the generator was not showing up in the list shown by the yo command.

finally i opened yeoman/yeoman#1640 and was given a few tips that led me to realize the mistake. before opening the issue above, i had run yo doctor several times, so if it had warned me that it was finding my generator but not showing it in the list because of a lack of defining a default, i would have realized and fixed my issue far more quickly.

if it matters, i expect that this would mostly be helpful only for npm linked generators since those are most likely work-in-progress.

npm version

I know that this issue is very similar to issue #19 and it seems like the internet has lots of solutions to this problem, but I have tried several and they don't seem to be working for me. I think I may have isntalled multiple versions of NPM, how can I confirm that? If that is indeed the problem, how can I purge and reinstall properly? Here's what is going on:

` sudo npm install -g yo generator-kraken bower grunt-cli
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
/home/sean/.npm/bin/grunt -> /home/sean/.npm/lib/node_modules/grunt-cli/bin/grunt
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
/home/sean/.npm/bin/yo -> /home/sean/.npm/lib/node_modules/yo/lib/cli.js

[email protected] postinstall /home/sean/.npm/lib/node_modules/yo
yodoctor

Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✖ npm version

Your npm version is outdated.

Upgrade to the latest version by running:
npm install -g npm

Found potential issues on your machine :(

[email protected] postinstall /home/sean/.npm/lib/node_modules/generator-kraken/node_modules/yeoman-generator/node_modules/cross-spawn/node_modules/spawn-sync
node postinstall

/home/sean/.npm/bin/bower -> /home/sean/.npm/lib/node_modules/bower/bin/bower
[email protected] /home/sean/.npm/lib/node_modules/grunt-cli
├── [email protected] ([email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected])

[email protected] /home/sean/.npm/lib/node_modules/yo
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] /home/sean/.npm/lib/node_modules/generator-kraken
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] /home/sean/.npm/lib/node_modules/bower
`
Thank you very much for your help, I know that this issue probably has a simple solution, I am just having a hard time understanding what it is.

NPM Install issue as part of Yo

I get the following whilst running npm i -g yo

[user@ip ~]$ npm i -g yo
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
/usr/bin/yo -> /usr/lib/node_modules/yo/lib/cli.js
/usr/bin/yo-complete -> /usr/lib/node_modules/yo/lib/completion/index.js

> [email protected] postinstall /usr/lib/node_modules/yo/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall /usr/lib/node_modules/yo/node_modules/ejs
> node ./postinstall.js


> [email protected] postinstall /usr/lib/node_modules/yo/node_modules/spawn-sync
> node postinstall


> [email protected] postinstall /usr/lib/node_modules/yo
> yodoctor

/usr/lib/node_modules/yo/node_modules/yeoman-doctor/lib/index.js:12
  (async () => {
         ^

SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/yo/node_modules/yeoman-doctor/lib/cli.js:3:1)
/usr/lib
└── (empty)

npm ERR! Linux 3.10.0-1127.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "-g" "yo"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `yodoctor`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'yodoctor'.

Doesn't look to be anything I can fix on the local machine, happy to be proven otherwise!

Template message output

Maintaining array/strings is pretty hard (and even harder to format correctly).

We should move to a template system and maintain the errors output inside text files.

(also, @sindresorhus was thinking about simplifying chalk coloring in templates - ETA on that?)

NODE_PATH matches the npm root - Unable to find the npm root, something went wrong.

I am unable to run yo, so I ran "yo doctor" and I am getting the error message below.

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 :(

NOTES:

  • NODE_PATH is set to c:\Program Files\nodejs\node_modules\
  • npm -g root --silent returns: C:\Program Files\nodejs\node_modules
  • Node.js version: 17.3.0
  • I ran "yo doctor" both as a regular user and as an administrator, same issue
  • yo --version: 4.3.0

image

npm

I tried installing yo using
npm install -g yo
but it gave the error for not having the correct version of npm installed
I already have the latest npm installed which is 2.11.1 as shown below:-
Kindly fix it, as i cannot installed generator like generator-ko


Your environment has been set up for using Node.js 0.12.4 (ia32) and npm.

C:\Users\kowsh>npm -version
2.11.1

C:\Users\kowsh>yo doctor

Yeoman Doctor
Running sanity checks on your system

V Global configuration file is valid
V NODE_PATH matches the npm root
V Node.js version
× npm version

Your npm version is outdated.

Upgrade to the latest version by running:
npm install -g npm

See this guide if you're having trouble upgrading:
https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

V No .bowerrc file in home directory
V No .yo-rc.json file in home directory

Found potential issues on your machine :(


Add unit test

Because unit test are super important!

Right now it is very shameful (and I admit it's my fault)

npm version should be 2.x

If you look at this commit c9c6a23 it means yeoman need npm3. But nodejs LTS is 4.X and this means npm is 2.X not 3.X

Should we revert partially this change and ask for node 4 and npm 2 ?

Make every rules async

Only supporting sync flow is pretty limiting (and not super future friendly). We should move to make every rule with a callback (even if they're not actually sync).

npm version check on windows

npm version check on windows shall use 'npm.cmd' as argument and not only 'npm' when calling binVersionCheck function

yo doctor is throwing an error after npm install latest version

Here is the output of the same:

$ yo doctor

/usr/local/lib/node_modules/yo/lib/cli.js:43
    require('yeoman-doctor').run();
                             ^
TypeError: Object function () {
  var errCount = 0;

  console.log('\n' + chalk.underline.blue('Yeoman Doctor'));
  console.log('Running sanity checks on your system\n');

  eachAsync(objectValues(rules), function (rule, i, cb) {
    rule.verify(function (err) {
      console.log(err ? symbols.error : symbols.success + ' ' + rule.description);

      if (err) {
        errCount++;
        console.log(err);
      }

      cb();
    });
  }, function () {
    if (errCount === 0) {
      console.log(chalk.green('\nEverything looks all right!'));
    } else {
      console.log(chalk.red('\nFound potential issues on your machine :('));
    }
  });
} has no method 'run'
    at pre (/usr/local/lib/node_modules/yo/lib/cli.js:43:30)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/lib/cli.js:156:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3

Add checks for multiple yo versions

I've seen this issue a few times. Basically the user have a yo version installed, and their npm now install in a different binary folder. This cause an issue where the user always use the old yo version as their new ones is not found on their path.

I'm unsure how we could detect this, but the issue is clear when you check where npm installs modules against what is returned with which yo (where yo on windows)

Related bug reports on our trackers

Checks formatting: Align left/right

I want to align our output correctly so it is easier to read:

[Yeoman Doctor] Running sanity checks on your system
NODE_PATH match the npm root....................................OK
Global configuration file is valid..............................OK

Everything looks all right!

Two goals:

  1. Having dotted line as separator (make it more "header" like)
  2. Spanning it to the terminal width when possible.

There's a lot of table modules that could work, but they return a blob string rather than line per line. We need line per line here because in case of errors, we'll output help information under each check line.

A solution could be to just split the table module output on new lines and match the index, but I want to run it to the team before. There's probably a solution out there already.

Crash if npm is not in the PATH

Currently yodoctor does a npm --version to get npm's version but that crashes if npm is not on the PATH.
It should instead only give a warning that npm was not found.
(I guess the fix could be in bin-version-check but the project doesn't seem very lively...)

See srs/gradle-node-plugin#134 for a use case where npm isn't found.

Stack trace:

Yeoman Doctor
Running sanity checks on your system

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

We found a undefined file in your home directory. This can cause
issues by overriding expected default config. Prefer setting up one `.bowerrc` per
project.

To delete the file, run: rm ~/.bowerrc

✔ No .yo-rc.json file in home directory
/home/jhipster/app/node_modules/semver-truncate/index.js:12
                throw new Error('Version ' + version + ' is not valid semver');
                ^

Error: Version null is not valid semver
    at module.exports (/home/jhipster/app/node_modules/semver-truncate/index.js:12:9)
    at /home/jhipster/app/node_modules/bin-version-check/index.js:20:25
    at /home/jhipster/app/node_modules/bin-version/index.js:15:3
    at ChildProcess.exithandler (child_process.js:197:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)

`yo doctor` doesn't resolve paths

Just realized yo doctor script doesn't resolve paths and match them based on their "string" value.

It should path.resolve() paths before comparison.

`yo doctor` just look up home dir

Hey,

I crashed to an issue where have to find out that yeoman did not scaffold in my current dir.
I put my in $HOME/code. In this directory I started a scaffold by mistake, so an .yo-rc.json was created.

yo doctor did not show me this in any kind, then I was in a dir like $HOME/code/myApplication. It was a stupid mistake on my side, but it could be useful if yeoman can tell me, that I have a yo-file in one of my parent directories to remove any surprise.

Doctor complains when installation is not global

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();
}
};

New release?

Following up on the three PRs from last month, could we get a new version so these changes can go live?

Error when checking NODE_PATH

Today I installed yeoman and yeoman doctor flagged an issue with "NODE_PATH matches the npm root".
In this Google did not appear to be my friend so I started investigating myself.
I found yeoman-doctor/lib/rules/node-path.js and started debugging the old way by adding console.log lines. In the exported function verify I added a console.log for the error in the catch. The error message read "TypeError: filepath.trim is not a function".

In the complete script file there is only one line with a trim function and that is in the function fixPath. That function is being called on 2 places, for each of the paths in the NODE_PATH environment value and once for the output of the command npm -g root --silent so I added a console.log line to the fixPath function to see the incoming value of filepath. The output of npm -g root --silent appeared to contain a new line character all the rest looked normal so I suspected that new line to be the culprit. So I tried to replace it with filepath.replace(/^\n|\n$/g, '') but it only made the error being thrown by the replace function instead. At this point I wondered how this could be, a quick Google and the wisdom of "don't trust your input" got me the idea of adding toString() to the filepath variable before the trim function. That did the trick, the error went away and "NODE_PATH matches the npm root" was being flagged as okay.

I could create a pull request for my fix but first I want to make sure if I'm not missing anything obvious.

doctor doesn't support proxy when used globally

When yeoman-doctor is installed globally (npm install -g yeoman-doctor), it doesn't use any proxy environment variables. That issue is related to yeoman/yo#589.

Example of error:

○ → yodoctor

Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
{ RequestError: connect ECONNREFUSED 104.16.27.35:443
    at ClientRequest.req.once.err (/home/simon/.nvm/versions/node/v8.12.0/lib/node_modules/yeoman-doctor/node_modules/got/index.js:73:21)

semver version vulnerability issue

In project scan we are getting vulnerability issue for semver version "Versions of the package semver before 7.5.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range, when untrusted user data is provided as a range."

Please update the semver version > 7.5.2.

"Your yo version is outdated"

When I try to install yeoman npm install -g yo, I receive the following status at the end of the install from yo doctor:

Yeoman Doctor
Running sanity checks on your system

√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ Node.js version
√ No .bowerrc file in home directory
√ No .yo-rc.json file in home directory
× yo version

Your yo version is outdated.

Upgrade to the latest version by running:
npm install -g yo@latest

√ npm version

Found potential issues on your machine :(

So I tried npm install -g yo@latest but I end up with the same issue. It is to be noted that it was the first time I installed yo on this machine. I could not find any ressource regarding this issue, but please let me know if there is a simple solution.

Thanks,

Warn if .bowerrc is in the home directory

This can cause problems if a generator counts on bower_components being in a specific place. In generator(-gulp)-webapp we fixed this by adding a local .bowerrc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.