Run npm i -g vue-cli
in terminal
vue-cli should install
The installation fails and this error is logged:
error path C:\Users\<my-user-folder>\AppData\Roaming\npm\node_modules\vue-cli\node_modules\js-beautify\js\bin\css-beautify.js
error code ENOENT
error errno -4058
error syscall chmod
error enoent ENOENT: no such file or directory, chmod 'C:\Users\<my-user-folder>\AppData\Roaming\npm\node_modules\vue-cli\node_modules\js-beautify\js\bin\css-beautify.js'
error enoent This is most likely not a problem with npm itself
error enoent and is related to npm not being able to find a file.
An issue has already been opened in js-beautify repo:
https://github.com/beautify-web/js-beautify/issues/1247
For a quick fix, you can install yarn and run yarn global add vue-cli
.
Seems this has to be solved in js-beautify. Good to know that yarn seems to work, though I wonder why.
@LinusBorg https://github.com/vuejs/vue-cli/blob/master/yarn.lock#L3192.
If we have a in this repo, npm would also work.package-lock.json
Edit: npm-shrinkwrap.json
instead of package-lock.json
here would make npm work.
@jddxf thanks, yarn works.
@jddxf I think an npm-shrinkwrap.json would be even better in this case: command line tools (such as vue-cli) are among the recommended use-cases mentioned in npm official documentation:
The recommended use-case for
npm-shrinkwrap.json
is applications deployed through the publishing process on the registry: for example, daemons and command-line tools intended as global installs ordevDependencies
.
@LucaBlackDragon You're right. I didn't realize the difference between package-lock.json
and npm-shrinkwrap.json
.
One key detail about package-lock.json is that it cannot be published, and it will be ignored if found in any place other than the toplevel package.
So having a package-lock.json
would not make npm work here.
@LucaBlackDragon That's a good point, we should think about using that.
/cc @vuejs/collaborators do you have any thoughts on this one?
yarn not install with npm but with the msi in win10 can install the cli successfully
Vue-cli doesn't depend on js-beautify directly. But some dependency bumped its dependency on js-beautify and that breaks us.
I would give a thumb up for npm-shirnkwrap.json, which is designed for avoiding such scenario.
The recommended use-case for npm-shrinkwrap.json is applications deployed through the publishing process on the registry: for example, daemons and command-line tools intended as global installs or devDependencies.
@HerringtonDarkholme hmm lockfile actually wouldn't work for end users, I think you mean npm-shrinkwrap.json
@egoist Sure. Thanks for correction.
Pull request is up, just needs permission to merge: https://github.com/beautify-web/js-beautify/pull/1251
dup of #591
Most helpful comment
For a quick fix, you can install yarn and run
yarn global add vue-cli
.