Vue-cli: vue ui fails on 3.0.0-rc.7 and Win10

Created on 27 Jul 2018  ·  8Comments  ·  Source: vuejs/vue-cli

Version

3.0.0-rc.7

Node and OS info

Node v8.11.3 / NPM 5.7.1 / Windows 10

Steps to reproduce

vue ui fails on arbitrary projects with error:

ERROR  Error: EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read
    at Object.fs.readSync (fs.js:675:18)
    at tryReadSync (fs.js:540:20)
    at Object.fs.readFileSync (fs.js:583:19)
    at windowsConfigPath (C:\Users\beat.grabe\AppData\Roaming\npm\node_modules\@vue\cli\lib\util\rcPath.js:30:35)
    at exports.getRcPath.file (C:\Users\beat.grabe\AppData\Roaming\npm\node_modules\@vue\cli\lib\util\rcPath.js:41:3)
    at Object.<anonymous> (C:\Users\beat.grabe\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@vue\cli-ui\apollo-server\util\db.js:18:5)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

What is expected?

The vue-cli user interface will open

What is actually happening?

The command is failing

Windows needs team repro

Most helpful comment

@Akryum I'm going to revert it because I don't see much benefit. The user who wants a different config location can use VUE_CLI_CONFIG_PATH anyway.

All 8 comments

Running in dev mode vue ui --dev seems to prevent the error.

I think its because it wants to read folder .vue-cli-ui but it should read only file.

It seems it's trying to read and create the .vue-cli-ui folder in your App Data but fails for some reason, maybe it doesn't have the rights.

What is the benefit of migrating vue config files from the homedir to the appdata dir on win10? I am aware of the related Issue #1957. For me it is totally fine (if it would or will work), but it is clearly missing a proper explanation, since .npmrc or .bashrc are localed in the home dir as well…

Generally speaking these are only my thoughts, but the code change apparently leads to a malfunction…

As @Samuell1 already mentioned, it has nothing to do with permissions, but with the function itself. The getRcPath function in vue-cli\packages\@vue\cli-ui\apollo-server\util\db.js is called with '.vue-cli-ui' which is a folder name:

// vue-cli\packages\@vue\cli-ui\apollo-server\util\db.js
…
folder = (
  process.env.VUE_CLI_UI_DB_PATH ||
  getRcPath('.vue-cli-ui')
)
…

On windows this is passed to another function windowsConfigPath(file), which expects a filename, e.g. .vuerc. In that function happens the mess then:

// vue-cli\packages\@vue\cli\lib\util\rcPath.js line 30
…
fs.writeFileSync(rcPath, fs.readFileSync(oldRcFile)) // expects rcPath to be a file but is folder
…

@beatgrabe good point. I don't use Windows very often so I'm not all that familiar with the conventions on Windows config files. The only upside I see is if the file is placed in AppData/Roaming you will be able to reuse it when you log onto another machine on the same domain. Although I'm not sure if that's a common need.

@yyx990803 The migration should work with folders as well.

@Akryum I'm going to revert it because I don't see much benefit. The user who wants a different config location can use VUE_CLI_CONFIG_PATH anyway.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghenry picture ghenry  ·  40Comments

tomers picture tomers  ·  35Comments

williamstar picture williamstar  ·  79Comments

wuyuweixin picture wuyuweixin  ·  35Comments

brunoseco picture brunoseco  ·  35Comments