4.1.1
System:
OS: Windows 7 6.1.7601
CPU: (4) x64 Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
Binaries:
Node: 10.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.5.0 - C:\Program Files\nodejs\npm.CMD
npmGlobalPackages:
@vue/cli: Not Found
@vue/cli 4.1.1 is actually installed globally and vue command is available.
vue create
vue create my-project
my-project
cd my-project
my-project
with serve
npm run serve
The project should start in development mode with hot reload.
The command terminates without starting anything.
If we run vue serve
instead of npm run serve
, it errors out the following in the terminal and exits:
Failed to locate entry file in my/project/directory/path.
Valid entry file should be one of: main.js, index.js, App.vue or app.vue.
So I am assuming npm run serve
tries to find either of the above mentioned files but is not able to find any and hence terminates. The reason is, none of the "entry" files are in the project's root directory but inside the src
directory.
What's the error log of npm run serve
and what's inside the generated project? Would you please upload the repository to GitHub so that we can debug on it?
There is no error on the terminal on running npm run serve
. It just terminates. Is there a dedicated log file to check the errors?
I have created a demo repository at https://github.com/pratik-abhyankar/my-app for reproduction. The contents of the project are the default files and folders created by vue-cli. I have not added any of my code or files in it.
This issue can be reproduced on any machine with the default steps of vue-cli, which are in sequence as vue create my-app
, cd my-app
and npm run serve
.
There is no error on the terminal on running npm run serve. It just terminates. Is there a dedicated log file to check the errors?
But there should be at least some output… Maybe it's related to npm? Because this project works totally fine on my machine (both Mac & Windows 10 Virtual Machine).
I currently have the same problem.
Cloning the repo above or creating a new project both have the same result, with the command simply returning without any output.
This is on Windows 10 as well.
How about .\node_modules\.bin\vue-cli-service.cmd serve
?
I figured out my issue, though I don't know if it also applies to @pratik-abhyankar
Turns out I forgot I had ignore-scripts set to true.
npm config set ignore-scripts false
or deleting .npmrc fixed the problem for me and the command now works as expected.
Nope, there is absolutely no output on the terminal on running npm run serve
. It just terminates and returns the control back to user. I installed latest Node.js, npm and vue-cli again and tried the same by creating a new project. I still face the same issue.
However, running the above command worked! I ran the following on my terminal (from VSCode integrated terminal, I use Git bash and not Command Prompt):
./node_modules/.bin/vue-cli-service serve
@Nocory Would you please share your environment information (Node.js, npm, vue-cli etc), and also try running it with this above command?
@Nocory Yes, you were right! I had previously set ignore-scripts to true which is why I was facing this issue. Setting it to false resolves the issue and npm run serve
works as intended.
Closing the issue as resolved.
I figured out my issue, though I don't know if it also applies to @pratik-abhyankar
Turns out I forgot I had ignore-scripts set to true.
npm config set ignore-scripts false
or deleting .npmrc fixed the problem for me and the command now works as expected.
Thanks, that resolved my issue.
Most helpful comment
I figured out my issue, though I don't know if it also applies to @pratik-abhyankar
Turns out I forgot I had ignore-scripts set to true.
npm config set ignore-scripts false
or deleting .npmrc fixed the problem for me and the command now works as expected.