-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Unable to npm run build on new project #5022
Comments
I just noticed that I'm only getting that error when building in production mode. |
I'm sorry but I can't reproduce this issue locally… |
Thanks for looking! I have uploaded the exact same code that I used when filling out the issue: https://github.com/ddreier/vue-cli-repro |
Still can't reproduce. As I looked into the code, seems the only possible way to trigger this issue is to remove |
I have only added
In my vue.config.js to get source maps. The build fails with and without that. |
Have you changed anything in It could be a dependency conflict. |
Like, what's the output of |
Only change to package.json is adding a new script. Otherwise it's straight out of
I just tried deleting Here's the output of
|
I googled the error message and the only reports I got are these: #5030 So it's a very rare issue. I noticed that all of the 3 cases are running on Windows (and maybe PowerShell). |
Wow, I didn't find that MS Tech Community thread when I was trying to search around. And what do you know, I did
|
I have tried with 4.1.0 and 4.0.5 and gotten the same error in PowerShell. Installed 3.12.1 and it's the same situation, PowerShell doesn't work but Command Prompt does. The actual error is different though:
|
Looks like webpack fails to load some loader/plugin when executed in PowerShell. I noticed that in the PS prompts it's |
Anyway, not likely a Vue CLI bug, if the real cause confirmed, please report to webpack. In Vue CLI we've already enabled the vue-cli/packages/@vue/cli-service/lib/config/base.js Lines 183 to 185 in 80b9395
|
Thanks for your help! It was the path casing. 🤦♂ |
closes vuejs#2547 closes vuejs#5032 I'm still very hesitant on adding this feature, though. First, this change allows project creation in a folder with uppercase letters in its name. It is strongly discouraged and may cause many weird issues all over the ecosystem. For example, vuejs#5022, vuejs#4424, vuejs#3665, vuejs#4174#issuecomment-569709494 are all caused by case issues. Adding support for uppercase project names will only worsen this situation. Secondly, it adds a lot of maintenance burden to us. As noted in the comments, these prompts are hard to test right now (because `createTestProject` runs in another process so it's hard to intercept the prompts). Even if such test utilities are added in the future, it's still very tedious to take care of all the case issues in the test suite. What's worse is that we can affect the project folders created by @vue/cli by converting the project name to lower case. But for `vue create .`, we cannot change the current folder's name. So, we'll have another edge case to test.
What is the solution for this? I also cannot run a build on a new project that was created with vue ui And the project name is lowercase. |
@douglasg14b the solution for me was to make sure that the path casing in my terminal matched the actual path casing in the filesystem (on Windows). Might be a different issue if your casing already matches. |
@ddreier Hi there! Very sorry to bother you, but I am very new to Vue and coding in general. Would you perhaps help by describing a bit more how can I check these paths (terminal vs filesystem) and fix them? |
I had a problem with path casing too, if i try to build the project using the wrong path casing it fails. Just to clarify:
@anzuj, check if it solve ur problem. |
Not sure if I'll have to use the plugin eventually. Reading through similar issues I tried running build command in powershell and it just worked. Guessing it resolves the casing properly. This issue for me is in using bash shell for windows which I would like to be able to continue using if anyone has a fix for that. |
I renamed every directory in lower case, worked fine, example "D:\Project\Test1\vueproject" to "D:\project\test1\vueproject" |
@ddreier I'm using the vue ui, how can I fix it's casing, or how it's handling casing? |
Changing all the alphabets in the path which i was are providing in my script to lower case made it work. |
Interestingly, it works for me in the good old cmd, but not in PowerShell... |
The problem is certainly caused by casing, however it seems that this issue has been closed without actually addressing it with a long term solution? |
Version
4.1.2
Environment info
Steps to reproduce
What is expected?
npm run build
works out of the boxWhat is actually happening?
Running
npm run serve
works, and runningvue build
from the src directory also works.I'm not sure why
vue info
says "@vue/cli: Not Found" when it clearly is installed. Before opening this issue I rannpm uninstall -g @vue/cli
andnpm install -g @vue/cli
.The text was updated successfully, but these errors were encountered: