Skip to content

Last version of js-beautify breaks vue-cli installation #592

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

Closed
LucaBlackDragon opened this issue Sep 18, 2017 · 13 comments
Closed

Last version of js-beautify breaks vue-cli installation #592

LucaBlackDragon opened this issue Sep 18, 2017 · 13 comments

Comments

@LucaBlackDragon
Copy link

Steps to reproduce:

Run npm i -g vue-cli in terminal

Expected behavior:

vue-cli should install

Actual behavior:

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.

Notes:

An issue has already been opened in js-beautify repo:
beautifier/js-beautify#1247

@jddxf
Copy link

jddxf commented Sep 18, 2017

For a quick fix, you can install yarn and run yarn global add vue-cli.

@LinusBorg
Copy link
Member

Seems this has to be solved in js-beautify. Good to know that yarn seems to work, though I wonder why.

@jddxf
Copy link

jddxf commented Sep 18, 2017

@LinusBorg https://github.com/vuejs/vue-cli/blob/master/yarn.lock#L3192.
If we have a package-lock.json in this repo, npm would also work.

Edit: npm-shrinkwrap.json instead of package-lock.json here would make npm work.

@chanlito
Copy link

@jddxf thanks, yarn works.

@LucaBlackDragon
Copy link
Author

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

@jddxf
Copy link

jddxf commented Sep 18, 2017

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

@LinusBorg
Copy link
Member

@LucaBlackDragon That's a good point, we should think about using that.

/cc @vuejs/collaborators do you have any thoughts on this one?

@lianghx-319
Copy link

yarn not install with npm but with the msi in win10 can install the cli successfully

@HerringtonDarkholme
Copy link
Member

HerringtonDarkholme commented Sep 18, 2017

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.

https://docs.npmjs.com/files/shrinkwrap.json

@egoist
Copy link
Collaborator

egoist commented Sep 18, 2017

@HerringtonDarkholme hmm lockfile actually wouldn't work for end users, I think you mean npm-shrinkwrap.json

@HerringtonDarkholme
Copy link
Member

@egoist Sure. Thanks for correction.

@sanderkoenders
Copy link

Pull request is up, just needs permission to merge: beautifier/js-beautify#1251

@posva
Copy link
Member

posva commented Sep 18, 2017

dup of #591

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

No branches or pull requests

9 participants