Skip to content
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

Nested template literals error #2345

Closed
non-self opened this issue Aug 24, 2018 · 5 comments
Closed

Nested template literals error #2345

non-self opened this issue Aug 24, 2018 · 5 comments
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author

Comments

@non-self
Copy link

Version

3.0.1

Node and OS info

Node v8.11.4 / npm 5.6.0 / yarn 1.9.4 / Fedora 28

Steps to reproduce

npm install -g @vue/cli

What is expected?

It is expected to get everything working. I just want to generate a new project and go to localhost:8080 and see my things.

What is actually happening?

@vue/cli is not installed properly.
I had Vue working on my machine without a problem. Then after upgrading @vue/cli to the newest version, everytime I tried to do a 'vue create app' project, I got an annoying error saying 'Failed to reload favicon' or something like that.


After fixing the template literals on this file (line 170) to return 'Missing required argument ${chalk.yellow(<${argName}>)}.', I went to @vue/cli root folder and did npm install. Now @vue/cli is installing other plugins that are required. I still have some other problems, and I'm only able to create a project when I go to the same folder where I have vue symlink. I do ./vue create app-name and I get everything working just fine.

@haoqunjiang
Copy link
Member

Sorry but I can't understand your problem.

Then after upgrading @vue/cli to the newest version, everytime I tried to do a 'vue create app' project, I got an annoying error saying 'Failed to reload favicon' or something like that.

Could you provide a detailed error message?

After fixing the template literals on this file (line 170) to return 'Missing required argument ${chalk.yellow(<${argName}>)}.',

What do you mean by "fixing the template literals"?

@haoqunjiang haoqunjiang added the needs reproduction This issue is missing a minimal runnable reproduction, provided by the author label Aug 24, 2018
@non-self
Copy link
Author

non-self commented Aug 24, 2018

Sorry. It's my first time doing this, and I'm totally noob. Just playing around with Vue.js for a while.
Few weeks back, I had Vue working on my machine without a problem. What I meant was that I could easly run 'vue create app', and then cd to that directory and do npm run serve or yarn serve and go to localhost.
But now, everytime I try to do the same step described above, I get into this same issue:
#2342
#1451

I'm really trying to understand what is going on, because maybe I'm missing something, that's why I said I'm totally noob. So I was thinking, let's go and check source code and learn a thing or two.
I started reading the code by going to @vue/cli directory and checking for stuff. When I was checking the vue.js file from @vue/cli/bin directory I saw a typo accused by syntax highlight on line 170, which means "something must be wrong aroud here", I thought.

Take a look on the backquotes here:

return Missing required argument ${chalk.yellow(<${argName}>)}.

`<${argName}>' must be escaped properly, right?

I don't know the whole Vue architecture, so I have no authority here, but something also must be problematic with npm on linux. If I install @vue/cli using yarn, I get a totally different installation. While using npm to install @vue/cli, what I get is only the cli folder. But when I install @VUE using yarn, I get these ones: cli, cli-shared-utils, cli-ui, cli-ui-addon-webpack. Maybe this is related to the following warnings given by npm/yarn:

info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.

What are the good news?

Well, after editing the code to return 'Missing required argument ${chalk.yellow(<${argName}>)}.', still a nightmare for me, because I'm only able to get the server running when I create a project from the same directory where I have a link to @VUE, which is ~/.nvm/versions/node/v8.11.4/bin/vue. Only from this folder I can get everything working fine.

Does this help?

@non-self
Copy link
Author

I'm trying to edit my comment, but the editor keeps removing my quotes.
See line 170 from this file: https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli/bin/vue.js

@haoqunjiang
Copy link
Member

I guess you have a % or some other special characters in your project path.

The nested template literal is legit and the encountered problem has nothing to do with it.

@non-self
Copy link
Author

You are totally right.
Since $PATH is an environmental variable in Unix-like operating-system, using, for example, '#folder-name' to name directories is wrong. Shell ignores everything following a '#' as a comment.
I renamed my project-folder and everything looks great now.
Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction This issue is missing a minimal runnable reproduction, provided by the author
Projects
None yet
Development

No branches or pull requests

2 participants