[bug] [windows] [npx] Windows Setup not generating greenlock.json #17

Closed
opened 2019-11-14 09:16:06 +00:00 by Ghost · 4 comments

Installing v3 on a win10 machine works up util the
npx greenlock defaults --subscriber-email 'jon@example.com' --agree-to-terms'
step.
When I run it, Notepad++ opens to greenlock.js, and never creates a greenlock.json file.
Running
npx greenlock add --subject example.com --altnames example.com
also does nothing and there is still no greenlock.json until I start with
npm start -- --staging
at which point I get the
warning: No sites available. Did you add them?
npx greenlock add --subject example.com --altnames example.com'
message.
I'm not sure on the structure of those json objects, so I cannot manually create them. Do you have any ideas I could try to get it running?

Thanks!

Installing v3 on a win10 machine works up util the npx greenlock defaults --subscriber-email 'jon@example.com' --agree-to-terms' step. When I run it, Notepad++ opens to greenlock.js, and never creates a greenlock.json file. Running npx greenlock add --subject example.com --altnames example.com also does nothing and there is still no greenlock.json until I start with npm start -- --staging at which point I get the warning: No sites available. Did you add them? npx greenlock add --subject example.com --altnames example.com' message. I'm not sure on the structure of those json objects, so I cannot manually create them. Do you have any ideas I could try to get it running? Thanks!
Owner

I forgot, this is a long-standing issue with npm/npx on Windows: you can't name a file the same name as a command (i.e. if you want to use npx greenlock, you can't have a file named greenlock.js)

Quick fix

move greenlock.js greenlock-x.js

And then edit server.js to use greenlock-x.js.

Long-term fix

I'm actually going to change the CLI to not create greenlock.js.

Format

Also, the format is in the README, https://git.rootprojects.org/root/greenlock-express.js#quickstart-guide under part 4, under example output.

I forgot, this is a long-standing issue with `npm`/`npx` on Windows: you can't name a file the same name as a command (i.e. if you want to use `npx greenlock`, you can't have a file named `greenlock.js`) **Quick fix** ``` move greenlock.js greenlock-x.js ``` And then edit `server.js` to use `greenlock-x.js`. **Long-term fix** I'm actually going to change the CLI to not create `greenlock.js`. **Format** Also, the format is in the README, https://git.rootprojects.org/root/greenlock-express.js#quickstart-guide under part 4, under `example output`.
coolaj86 changed title from Windows Setup not generating greenlock.json to [bug] [windows] [npx] Windows Setup not generating greenlock.json 2019-11-14 16:30:08 +00:00
Author

Thank you @solderjs!
That worked perfectly and I was able to run start without issue!

Thank you @solderjs! That worked perfectly and I was able to run start without issue!
Ghost closed this issue 2019-11-15 03:28:03 +00:00
Owner

Re-opening until I actually merge the patch.

Re-opening until I actually merge the patch.
coolaj86 reopened this issue 2019-11-15 03:29:13 +00:00
Owner

This is fixed with v4.

This is fixed with v4.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: root/greenlock-express.js#17
No description provided.