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

Created on 29 May 2018  ยท  26Comments  ยท  Source: vuejs/vue-cli

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)
bug now

Most helpful comment

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

All 26 comments

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

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

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

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

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

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

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

I'm on RHEL7

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

happening with 3.0.0-beta.14.

๐Ÿ˜† a temporary solution maybe:

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

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...


> [email protected] 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)

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

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

@Akryum

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

Not work

@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 ๐Ÿ˜„

@mashirozx Could you try node 8.11.2 please?

@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.

@zigomir So it worked with node 8.9.4 for you?

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

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

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.

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

@Akryum Yes, Node v8.11.2 works ๐Ÿ‘

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshuajohnson814 picture joshuajohnson814  ยท  3Comments

wahidrahim picture wahidrahim  ยท  3Comments

OmgImAlexis picture OmgImAlexis  ยท  3Comments

Akryum picture Akryum  ยท  3Comments

jgribonvald picture jgribonvald  ยท  3Comments