beautifier / js-beautify

Beautifier for javascript
https://beautifier.io
MIT License
8.61k stars 1.39k forks source link

Installing js-beautify fails #1247

Closed danrot closed 7 years ago

danrot commented 7 years ago

Description

I am trying to install a library, which is dependant on this one, and starting today (I've tried the last week the last time) I get the following error when installing my dependencies:

npm ERR! path /Users/daniel.rotter/Development/massiveart/sulu-minimal/vendor/sulu/sulu/node_modules/js-beautify/js/bin/css-beautify.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/daniel.rotter/Development/massiveart/sulu-minimal/vendor/sulu/sulu/node_modules/js-beautify/js/bin/css-beautify.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/daniel.rotter/.npm/_logs/2017-09-18T05_55_47_583Z-debug.log

It looks to me like this is somehow connected to the latest 1.7.0 release... Any ideas?

Steps to Reproduce

Create a new folder and install this library as dependency using npm install js-beautify.

Environment

OS: Mac OSX 10.11.6

Deleted most of the PR template, since it's not relevant.

efecantaslak commented 7 years ago

What a shit monday ha?

schoening commented 7 years ago

Step one. Convince boss we should use vue. Step two. This issue. edit: Ok, we should probably not use this as a chat.. Sorry.

hyprstack commented 7 years ago
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.9.41-moby
npm ERR! argv "/usr/local/nvm/versions/node/v6.9.1/bin/node" "/usr/local/nvm/versions/node/v6.9.1/bin/npm" "install"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! path /usr/src/app/node_modules/js-beautify/js/bin/css-beautify.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/src/app/node_modules/js-beautify/js/bin/css-beautify.js'
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/src/app/node_modules/js-beautify/js/bin/css-beautify.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log
Husky110 commented 7 years ago

the day, they drove my source-code down... singz in country

niahmiah commented 7 years ago

To install vue-cli: npm install -g js-beautify@1.6.14 vue-cli

muro25 commented 7 years ago

Install vue-cli with yarn then just replace js-beautify section in yarn.lock of your application with this: js-beautify@^1.6.3: version "1.6.14" resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.6.14.tgz#d3b8f7322d02b9277d58bd238264c327e58044cd" dependencies: config-chain "~1.1.5" editorconfig "^0.13.2" mkdirp "~0.5.0" nopt "~3.0.1"

this worked for me. I copied it from an older vue project.

yenchieh commented 7 years ago

@niahmiah Thank you! Your solution works for me!

jacintopazo commented 7 years ago

@niahmiah Thank you! Your solution works for me!

amatiasq commented 7 years ago

Same here, installing our package now crashes because of this. We had to release patch for last 3 versions replacing "js-beautify": "^1.6.4", with "js-beautify": "~1.6.4",

JonSnow-JY commented 7 years ago

In Mac ,use the methods before ,It's OK for me,but the windows is wrong.

bchandel0810 commented 7 years ago

not working for sequelize-cli

floriandorre commented 7 years ago

@niahmiah solution works, ty soo much i can finally work ! ('npm install -g js-beautify@1.6.14 vue-cli')

JonSnow-JY commented 7 years ago

@ ustbhuangyi thanks teacher

yar-usenko commented 7 years ago

we are fucked.

Exulansis commented 7 years ago

I assume it's an honest mistake, but come on, these things should be well tested before rolled out...

weizs commented 7 years ago

rm -rf node_modules/ rm -rf yarn.lock add this to package.json

"resolutions": {
     "js-beautify": "1.6.14"
 }

yarn ok

tetedacier commented 7 years ago

Temporarily, if you have a local copy of your project which work, try npm-shrinkwrap, update all the reference to js-beautify and add the npm-shrinkwrap.json file.

You will fix all version of all dependencies of your project but with with a working version of js-beautify if you npm. As soon as the latest version will be fixed, remove the npm-shrinkwrap.json file.

floriandorre commented 7 years ago

solution : https://github.com/beautify-web/js-beautify/issues/1247#issuecomment-330237551 (@niahmiah)

Sun1ive commented 7 years ago

for vue-cli vue-init webpack project-name cd project-name npm install js-beautify@1.6.14 --save-dev npm install works for me

alexkates commented 7 years ago

adding "js-beautify": "1.6.14", to my package.json worked. Thanks @weizs

pjar commented 7 years ago

npm is npm - shame, it would quite easy to avoid such situations, just make dummy package.json with most used packages and before someone updates any of those, make sure this dummy thing builds.

mputilin commented 7 years ago

+1

sun-slaven commented 7 years ago

fucked!

elieandraos commented 7 years ago

Facing the same issue for the past couple of hours !

fernandojunior commented 7 years ago

+1!

evocateur commented 7 years ago

Wish I could lock this thread, this is fucking ridiculous.

WE ARE AWARE OF THE ISSUE, STOP SPAMMING AND USE THE POSTED WORKAROUNDS.

natanaelyabes commented 7 years ago

Just go back and use react / angular already.

amatiasq commented 7 years ago

@evocateur People is having important issues because of this, at least let them express it, otherwise we won't know how big the impact is.

qm3ster commented 7 years ago

Adding

,
  "resolutions": {
    "js-beautify":"1.6.14"
  }

to the end of your package.json and running yarn also works

@amatiasq they can just upvote the issue, no reason to write what already has been said while making it harder to find workarounds.

I wonder if this will be as historically remembered as when leftpad was deleted from npm.

fernandojunior commented 7 years ago

https://stackoverflow.com/questions/46274964/no-such-file-or-directory-while-installing-js-beautify-in-npm

pjar commented 7 years ago

@evocateur possibility to slam others maybe will make this global npm problem solved one day. Everyone hates npm now.

LeonardLmyt commented 7 years ago

Global installation of "js-beautify" to solve the problem
cnpm install js-beautify@1.6.14 -g

jmelfi commented 7 years ago

@evocateur that's helpful for people but it's also a huge issue as Atom/Atom-Beta packages are broken and there is not a good way to force those internal packages. The atom package manager (apm) and the packages for Atom Editor are broken since many of them including atom-beautify use this package directly.

I agree that if you are on NPM/Yarn project you can easily and quickly fix this but for other users, this is quite breaking.

qm3ster commented 7 years ago

Oh look, what's this? :open_mouth:

A link to the official /beautify-web/js-beautify gitter so you don't have to spam here?

Truly revolutionary!

CubixSystem commented 7 years ago

@weizs Are you using yarn install --flat ?

"resolutions": { "js-beautify": "1.6.14" }

GabMic commented 7 years ago

I have the same problem.

Windows 10.

lemonpole commented 7 years ago

everybody panic

htunnicliff commented 7 years ago

@muro25 Your solution worked for me!

qm3ster commented 7 years ago

@RuinSain, Windows 10 is a real serious problem. Get rid of it immediately!

Emergency fix for vue-loader is incoming: https://github.com/vuejs/vue-loader/commit/97bd432bba4350988bfd0db6d7a1a514b66a9826

weizs commented 7 years ago

@CubixSystem yarn need 1.x.x

mohamedmezlini commented 7 years ago

me 2 and i fixed it with "dependencies": { "js-beautify": "1.6.14", .... }

kyr0 commented 7 years ago

Btw...post mortem... "Don't publish unnessessary files" ;)

https://github.com/beautify-web/js-beautify/pull/1241

evocateur commented 7 years ago

I don't have permissions to the repo anymore, but I still have ownership of the npm package. I just published v1.7.1 that contains all necessary files.

Please, stop spamming this thread. As soon as @bitwiseman is back on the grid, he can handle the PR and whatnot.

qm3ster commented 7 years ago

Important update for everyone that used these fixes in vuejs

Time to remove "js-beautify": "1.6.14" from your "dependencies":{} and "resolve":{} vue-loader@13.0.5 has been published, please update.

https://twitter.com/vuejs/status/909785891941617664

tong36 commented 7 years ago

@niahmiah @Sun1ive thanks。 It's very useful to me.

TheLarkInn commented 7 years ago

Hey @bitwiseman could I suggest locking this thread just so save yourself the spam. Appreciate all the work you do.

qm3ster commented 7 years ago

@evocateur, what's the difference between v1.7.1 and v1.7.2?

steveheinsch commented 7 years ago

@qm3ster You can compare versions on GH yourself, you know ;)

https://github.com/beautify-web/js-beautify/compare/v1.7.1...v1.7.2

bitwiseman commented 7 years ago

@TheLarkInn Thanks for the suggestion. 😄

To everyone else,

I apologize.

The issue is fixed.

I thought I had sufficient test coverage and I did not. Tests will be implemented to protect against this before the next release (#1254).

Also, this break highlights the need to create a beta channel for releases and a way to request feedback on beta releases (#1255).

Finally, the project has been maintained by mostly one person over the past year or so, with some additions by other individuals. This break also highlights the need for this project to have a few more people who have the ability address issues/emergencies (#1256).

Help with these would be appreciated.

PS: I thought I'd delete a bunch of the "+1" and "me too" comments until I realized there were over 200 of them. 😱