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

Validator CLI: The system cannot find the path specified. #5855

Closed
msroberts opened this issue Oct 27, 2016 · 7 comments · Fixed by #5983
Closed

Validator CLI: The system cannot find the path specified. #5855

msroberts opened this issue Oct 27, 2016 · 7 comments · Fixed by #5983
Assignees

Comments

@msroberts
Copy link

When I install the Validator Command Line Tool, it appears to install correctly, but when I try to use it, I get the following error:

The system cannot find the path specified.

It's entirely possible this is a problem with my system, but all other node modules I have tried work.

How do we reproduce the issue?

npm install -g amphtml-validator
amphtml-validator https://www.ampproject.org/

I am using 64-bit Windows 7 with the following:

  • node: v6.9.1
  • npm: 3.10.9
  • amphtml-validator: 1.0.14
@jridgewell
Copy link
Contributor

/to @powdercloud

@powdercloud
Copy link
Contributor

I think for starters the issue here is that https://github.com/ampproject/amphtml/blob/master/validator/nodejs/index.sh won't run on Windows. Sorry about this. There may be a work-around, by looking for the index.js file which should be somewhere in the node_modules amphtml-validator directory, and executing that with node directly. But I'm not familiar enough with nodejs on Windows to say how that would be done specifically.
And we should fix this - it would be good to support Windows. But my first step here is to find a Windows box - perhaps a virtual one.
If anyone seeing this bug has an idea already as to how to fix it, please bring it on.
PS: Windows 7 in particular was discontinued (https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet). For web development in general, a more recent OS version may be a good thing to consider. But I think we should try to support some Windows in any case.

@msroberts
Copy link
Author

Thanks for letting me know. For now I'll just keep using the browser extension (my work computer's OS is not likely to be updated any time soon!)

@powdercloud
Copy link
Contributor

powdercloud commented Oct 27, 2016

OK, I found a Windows machine (normally used for gaming in the office haha ...). After installing node.js with the binary installer, I was able to install amphtml-validator with npm -g amphtml-validator, just like you did. And my versions are node v6.9.1 and npm v3.10.8. The error message that I see when running amphtml-validator directly is also exactly what you saw ("The system cannot find the path specified").
So, there is a work-around. I located the npm installation directory - in my case it's C:\Users\AppData\Roaming\npm\node_modules\amphtml-validator. In this directory, there's an index.js. You can run this with the regular Windows command line (cmd.exe), e.g. from within this directory
node index.js https://www.ampproject.org/
will then print
https://www.ampproject.org/: PASS
and
node index.js
will print the help.

@msroberts
Copy link
Author

@powdercloud That worked, thanks!

@powdercloud
Copy link
Contributor

Wanted to update since the npm is updated now. The workaround posted above is no longer necessary. After installing with npm install -g amphtml-validator on a Windows machine, running amphtml-validator in cmd.exe should just work.

@msroberts
Copy link
Author

@powdercloud Looks like it's working!

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

Successfully merging a pull request may close this issue.

4 participants