vuepress / create-vuepress

Scaffolding out a VuePress docs, blog, repro repo or other interesting things
MIT License
67 stars 12 forks source link

Blog scaffold doesn't work correctly #2

Closed cfjedimaster closed 5 years ago

cfjedimaster commented 5 years ago

I believe this is an issue with the scaffolding code and not vuepress itself. I made a new vuepress site using the blog app and when I run yarn dev I get this:

 /m/c/p/v/d/test1 yarn dev                                                                                      08:41:03
yarn run v1.12.3
$ vuepress dev blog
Extracting site metadata...Error: [vuepress] Failed to load custom theme "@vuepress/theme-blog". File vuepress-theme-@vuepress/theme-blog/Layout.vue does not exist.
    at resolveOptions (/home/ray/.npm-global/lib/node_modules/vuepress/lib/prepare.js:132:15)
    at prepare (/home/ray/.npm-global/lib/node_modules/vuepress/lib/prepare.js:37:25)
    at dev (/home/ray/.npm-global/lib/node_modules/vuepress/lib/dev.js:21:25)
    at args (/home/ray/.npm-global/lib/node_modules/vuepress/bin/vuepress.js:104:12)
    at Command.program.command.description.option.option.action (/home/ray/.npm-global/lib/node_modules/vuepress/bin/vuepress.js:31:21)
    at Command.listener (/home/ray/.npm-global/lib/node_modules/vuepress/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:182:13)
    at Command.parseArgs (/home/ray/.npm-global/lib/node_modules/vuepress/node_modules/commander/index.js:651:12)
    at Command.parse (/home/ray/.npm-global/lib/node_modules/vuepress/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/home/ray/.npm-global/lib/node_modules/vuepress/bin/vuepress.js:96:9)
Done in 2.60s.
cfjedimaster commented 5 years ago

Ok, running npm i fixed it, but I don't remember the CLI suggesting it, nor does the README.md file mention it.

ulivz commented 5 years ago

Thanks for the report, but I cannot reproduce it, can you meet this error for now?

cfjedimaster commented 5 years ago

Meet? You mean repeat it?

ulivz commented 5 years ago

Yes, since I cannot reproduce it.

cfjedimaster commented 5 years ago

So if you do not run npm i, it works out of box?

ulivz commented 5 years ago

Hmmm? So you just run the yarn dev without installing deps?

cfjedimaster commented 5 years ago

Yep. Is it expected we should run the scaffold, npm i, and then yarn dev?

ulivz commented 5 years ago

Hmmm, a scaffolding tool just help you create the project.

BTW, when you cloned a GitHub project down, don't you install dependencies? Besides, isn't direct yarn or npm i common sense? (Hmmm, why mixing use of NPM and yarn?)

cfjedimaster commented 5 years ago

It may be just me not being familiar with Yarn, but I've used other tools that will auto run npm i for you. In this case, can we simply not add a message to the documentation?

ulivz commented 5 years ago

feel free to submit a pull request~

cfjedimaster commented 5 years ago

Maybe I'm not being clear. :) I'm asking you how I can do certain things. Let's make it simple. Given that I have no posts and the home page is empty, how would I modify the home page to say something like, "No Posts". Or heck, even if I do have posts, how do I modify the home page blog view?

cfjedimaster commented 5 years ago

Sorry! Last comment was about another thread we're having!

cfjedimaster commented 5 years ago

Done - PR #3.

ulivz commented 5 years ago

Merged.