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

Crash if npm is not in the PATH #33

Open
cbornet opened this issue Dec 14, 2016 · 2 comments
Open

Crash if npm is not in the PATH #33

cbornet opened this issue Dec 14, 2016 · 2 comments

Comments

@cbornet
Copy link

cbornet commented Dec 14, 2016

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)
@sindresorhus
Copy link
Member

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
Copy link
Author

cbornet commented Dec 14, 2016

Oh ! I didn't see you maintained both projects 😄

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

No branches or pull requests

3 participants