yeoman / doctor

Detect potential issues with users system that could prevent Yeoman from working correctly
http://yeoman.io
BSD 2-Clause "Simplified" License
61 stars 16 forks source link

Crash if npm is not in the PATH #33

Open cbornet opened 7 years ago

cbornet commented 7 years ago

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 https://github.com/srs/gradle-node-plugin/issues/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)
sindresorhus commented 7 years ago

but the project doesn't seem very lively...

That's a common unfortunate misassumption. The project is just done. No open issues and no new features needed.

cbornet commented 7 years ago

Oh ! I didn't see you maintained both projects :smile: