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

vue create node under v8.10.0: Error: Failed to resolve plugin: @vue/cli-service #1396

Closed
zigomir opened this issue May 29, 2018 · 26 comments
Closed

Comments

@zigomir
Copy link
Contributor

zigomir commented May 29, 2018

Version

3.0.0-beta.14

Reproduction link

https://github.com/vuejs/vue-cli

Steps to reproduce

npm i -g @vue/cli or yarn add global @vue/cli.
Then run vue create <project-name> and select default settings.

What is expected?

Command to scaffold project and install dependencies.

What is actually happening?

Command creates package.json, package-lock.json files and installs some (or all?) dependencies into node_modules dir, but doesn't scaffold any other files.

It fails with error:

🚀  Invoking generators...
 ERROR  Error: Failed to resolve plugin: @vue/cli-service
Error: Failed to resolve plugin: @vue/cli-service
    at Creator.resolvePlugins (/Users/ziga/.nvm/versions/node/v8.9.4/lib/node_modules/@vue/cli/lib/Creator.js:303:15)
    at Creator.create (/Users/ziga/.nvm/versions/node/v8.9.4/lib/node_modules/@vue/cli/lib/Creator.js:146:32)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
@C-Higgins
Copy link

Can confirm this happening in beta.12 and above. Beta.11 works fine

@pedrolopes-ilv
Copy link

Can confirm this happening in beta .12 and above too.

@LinusBorg
Copy link
Member

Are you on windows 10? I think I heard a couple of people report problems with 10

@marco-carvalho
Copy link

@LinusBorg i'm on win10 with 3.0.0-beta.14 and this is happening

@yyx990803
Copy link
Member

@Akryum can you look into this? I believe it's related to the changes to resolveModules here merged from the UI branch.

@doot0
Copy link

doot0 commented May 29, 2018

Happening on macOS High Sierra 10.13.4 with 3.0.0-beta.14.

@andrewbusch7
Copy link

Happening for me on Win 7 with 3.0.0-beta.14

@C-Higgins
Copy link

I'm on RHEL7

@zhangbobell
Copy link

Me too, happening on macOS High Sierra 10.13.4 with 3.0.0-beta.14.

@iquejay
Copy link

iquejay commented May 30, 2018

happening with 3.0.0-beta.14.

@zhangbobell
Copy link

😆 a temporary solution maybe:

  1. install beta.11
  2. create new project
  3. upgrade to beta.14

@mashirozx
Copy link

The same issue:

C:\WorkDirectory\GitHub\vue-test>vue create my-project


Vue CLI v3.0.0-beta.14
? Please pick a preset: default (babel, eslint)


Vue CLI v3.0.0-beta.14
✨  Creating project in C:\WorkDirectory\GitHub\vue-test\my-project.
🗃  Initializing git repository...
⚙  Installing CLI plugins. This might take a while...


> yorkie@1.0.3 install C:\WorkDirectory\GitHub\vue-test\my-project\node_modules\yorkie
> node bin/install.js

setting up Git hooks
done

added 1465 packages in 204.049s

🚀  Invoking generators...
 ERROR  Error: Failed to resolve plugin: @vue/cli-service
Error: Failed to resolve plugin: @vue/cli-service
    at Creator.resolvePlugins (C:\Users\Mashiro\AppData\Roaming\npm\node_modules\@vue\cli\lib\Creator.js:303:15)
    at Creator.create (C:\Users\Mashiro\AppData\Roaming\npm\node_modules\@vue\cli\lib\Creator.js:146:32)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

@mashirozx
Copy link

mashirozx commented May 30, 2018

@zhangbobell beta.14 still not work on Windows...

@Akryum
Copy link
Member

Akryum commented May 30, 2018

If you can, please try upgrading to node 8.9.x or newer and report back if it works for you.

@mashirozx
Copy link

mashirozx commented May 30, 2018

@Akryum

C:\WorkDirectory\GitHub\vue-test>node -v
v8.9.1

Not work

@zhangbobell
Copy link

@mashirozx I means you could totally remove vue-cli beta.14 and install beta.11, then create project, finally you could upgrade from beta.11 to beta.14 😄

@Akryum
Copy link
Member

Akryum commented May 30, 2018

@mashirozx Could you try node 8.11.2 please?

@zigomir
Copy link
Contributor Author

zigomir commented May 30, 2018

@Akryum I just updated node from 8.9.4 to 8.11.2 and it works in this version of node. I first tried with npm 5.6.0 (which comes with 8.9.4 – it works) and even with 6.1.0 it works.

@Akryum
Copy link
Member

Akryum commented May 30, 2018

@zigomir So it worked with node 8.9.4 for you?

@zigomir
Copy link
Contributor Author

zigomir commented May 30, 2018

@Akryum no, it doesn't work in 8.9.4.

@Akryum
Copy link
Member

Akryum commented May 30, 2018

Ok. Also npm shouldn't be the cause of the issue.

@zigomir
Copy link
Contributor Author

zigomir commented May 30, 2018

It works in 8.10.0 too. Looking at https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli/lib/util/module.js#L4 and https://nodejs.org/en/blog/release/v8.10.0/ (search for require.resolve) I'm almost sure it is related.

@Akryum
Copy link
Member

Akryum commented May 30, 2018

Yes it's related. So the working version of require.resolve(request, options) is 8.10.0, thanks!

I implemented a fallback resolver for older versions of node:

capture d ecran 2018-05-30 a 09 48 24

@zigomir zigomir changed the title vue create not working vue create not working in node version under v8.10.0 May 30, 2018
@mashirozx
Copy link

@Akryum Yes, Node v8.11.2 works 👍

@Akryum Akryum changed the title vue create not working in node version under v8.10.0 vue create node under v8.10.0: Error: Failed to resolve plugin: @vue/cli-service May 30, 2018
@Akryum Akryum mentioned this issue May 30, 2018
@macwac
Copy link

macwac commented Jun 6, 2018

i have same problem on node 9.2.1 and vue-cli v3.0.0-beta.15

@LinusBorg
Copy link
Member

then open a new issue. this one is outdated and closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests