3.0.3
Node 8.12.0 / yarn 1.9.4 / Ubuntu
The issue can be reproduced by trying to initialize a project that has uppercase letters in its name. vue create Uppecase
will give this error.
This is error isn't so obvious when you try to initialize a project with vue create .
in the current directory which has uppercase letters in its name. In this case, it just says Invalid project name: "."
.
vue-cli should allow me to create projects that have uppercase letters in their name.
vue-cli is not letting me create projects that have uppercase letters in their name.
If anyone's looking for a temporary solution, the check can be bypassed by editing the lib/create.js file. The file's path can be found by running readlink -f $(which vue)
. That's how I solved this for now.
npm init
does not support uppercase letters, neither does create-react-app
.
See https://github.com/facebook/create-react-app/issues/2165
I don't think we should support this use case. Though, the error message could be improved.
I think -f
flag should still be provided. Not everyone wants to publish their projects to npm.
As a beginner Vue developer coming from the desktop programming world, this caused a bunch of confusion for me. I always name my desktop projects in Pascal case and it took me a bunch of attempts to figure out why I was getting the error. I could see a user with less patience giving up.
I'm glad that I finally know the reasoning behind this, but I would still prefer to keep my normal development naming convention. My work-around has been to use the Vue CLI GUI (which doesn't seem to have the same limitation).
I would be happy with a -f
flag or similar option. Either way, a more descriptive error message might prevent a lot of frustration from other developers that are not familiar with Vue naming conventions.
I've opened a PR implementing this but I haven't decided whether to merge it. https://github.com/vuejs/vue-cli/pull/5096
Even if you don't need to publish the package to npm, there could still have edge cases with regard to path cases. It could be a real maintenance burden for us. (And it has already caused many issues).
Using a PascalCase name is an aesthetic issue most of the time. But the problems it encountered in the Node.js ecosystem are real.
For whatever it's worth, some businesses have project name requirements that require capital names. Our work does, but sadly we don't use Vue at work, so it's not an issue, but I subconsciously followed our work naming scheme at home now and really think this is a bad idea.
Most helpful comment
As a beginner Vue developer coming from the desktop programming world, this caused a bunch of confusion for me. I always name my desktop projects in Pascal case and it took me a bunch of attempts to figure out why I was getting the error. I could see a user with less patience giving up.
I'm glad that I finally know the reasoning behind this, but I would still prefer to keep my normal development naming convention. My work-around has been to use the Vue CLI GUI (which doesn't seem to have the same limitation).
I would be happy with a
-f
flag or similar option. Either way, a more descriptive error message might prevent a lot of frustration from other developers that are not familiar with Vue naming conventions.