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.

floriandorre commented 7 years ago

i'm trying this issue https://github.com/beautify-web/js-beautify/issues/1247#issuecomment-330171050 i will tell you if it works @tst11

alexz18 commented 7 years ago

+1

tstasiulionis commented 7 years ago

All right @floriandorre ! :)

stas-ut21 commented 7 years ago

I solved the problem this way: 1)rm -rf node_modules/ 2)npm install --save-dev js-beautify@1.6.14 3) add in package.json: "resolutions": { "js-beautify": "1.6.14" } 4)npm i

floriandorre commented 7 years ago

@tst11 this isn't working for me XD

jiyuefeng commented 7 years ago

悲伤逆流成河

stas-ut21 commented 7 years ago

also I had a problem with node-sass today: I solved the problem this way: 1)npm update 2)npm install 3)nodejs node_modules/node-sass/scripts/install.js 4)npm rebuild node-sass maybe someone will come in handy

iGarym commented 7 years ago

Can not fix it use below steps

The steps is incorrent? @danrot

xierenyuan commented 7 years ago

haha 论lock 的重要性

amit27kmr commented 7 years ago

+3 We are also facing the same issue

floriandorre commented 7 years ago

the only issue i found is to use a pre-build repo :/

abarcenas29 commented 7 years ago

sequelize-cli also breaks. Just waiting for the fix that I hope gets done today.

scripterkaran commented 7 years ago

vue-loader breaks in 1.7

lexeech commented 7 years ago

shits happens

steven-qi commented 7 years ago

强帖留名!

floriandorre commented 7 years ago

https://github.com/floriandorre/pre-build-vue-cli for those who rly need vue-cli today (npm install is already done you can npm run dev)

FrontierFox commented 7 years ago

Workaround: create a shrinkwrap for your project and force dependency versions for affected packages (e.g. vue-loader for me).

Create a npm-shrinkwrap.json file alongside where your package.json lives, add the following:

{ 
  "dependencies": { 
    "vue-loader": { 
      "version": "^13.0.1", 
      "dependencies": { 
        "js-beautify": { 
          "version": "1.6.14" 
        } 
      } 
    } 
  } 
}

You may need to adjust version numbers, and if you have multiple dependencies relying on js-beautify you'll have to list them all in there.

steven-qi commented 7 years ago

Please either un-publish the current version, or fix it ASAP...!

alexzabyshny commented 7 years ago

I can't install vue-cli, because this error crashes, omg :C

steven-qi commented 7 years ago

this works for me.

package.json:

  "resolutions": {
     "js-beautify": "1.6.14"
   }
ghost commented 7 years ago

@steven-qi Where is the package.json file stored? Trying to install vue-cli but I can't.

steven-qi commented 7 years ago

@gbaggaley I don't use vue, so I cannot answer your question. For node.js/npm based project, it is right in the root folder of project/package.

alexz18 commented 7 years ago

Change my package.json to version 1.6.14 helps to me for the "sequelize-cli" issue: ... "dependencies": { ... "request": "^2.81.0", "js-beautify": "1.6.14", "sequelize": "^4.8.2", ...

alexzabyshny commented 7 years ago

We can't install vue-cli, change dev dependency is not working.

alexz18 commented 7 years ago

try to downgrade vue-cli package to some previous version also

alexzabyshny commented 7 years ago

It makes no sense, because webpack just pulls out the latest version of this module.

amit27kmr commented 7 years ago

This worked for us:-

Create npm-shrinkwrap.json parallel to package.json

{ 
  "dependencies": 
   { 
     "js-beautify": 
     { 
        "version": "1.6.14"
      }
    } 
} 

This will work even if js-beautify is internally used in some other packages.

alexzabyshny commented 7 years ago

I apologize, but can you give a way where to create this file? I used linux, but I installed windows, and I do not know where to put this file.

moso commented 7 years ago

I know people are frustrated by this, myself included.

However, hotfixing it through ones package.json-file isn't going to look neat in the long run, if you have multiple developers on a project. Suddenly you're installing older versions of packages you don't really need, but are needed by some other dependency.

I'm sure an issue with, at the moment, 157 comments will get the attention of the developers. And I'm sure it'll all be fixed very soon, as I see several PR's have already been made.

amit27kmr commented 7 years ago

@hydrostasis just create a file npm-shrinkwrap.json parallel to package.json. Create this file manually as you create others.

alexzabyshny commented 7 years ago

No, i want install vue-cli, but i can't, there is no file packedge.json.

HadiChen commented 7 years ago

Can this bug fix it quickly? I have a project to go online tonight

adam-lynch commented 7 years ago

@hydrostasis (or anyone else using vue-cli), see https://github.com/beautify-web/js-beautify/issues/1247#issuecomment-330171050.

alexzabyshny commented 7 years ago

@adam-lynch ty :3

huysh3 commented 7 years ago

@hydrostasis npm install -g vue-cli --registry=https://registry.npm.taobao.org try this

michaeljhopkins commented 7 years ago

+1

oriweingart commented 7 years ago

+1

sdeboeck commented 7 years ago

+1

aZilberstein commented 7 years ago

Ran into this issue as well...

brickgale commented 7 years ago

sad. vue-cli and vue-loader breaking cuz of this.

rof20004 commented 7 years ago

@steven-qi comments solved my issue with vue-loader.

add this to package.json.

"resolutions": {
     "js-beautify": "1.6.14"
   }
frozenex commented 7 years ago

you broke vue :'(

ihorrusinko commented 7 years ago

https://github.com/epoberezkin/ajv/issues/563

vivian-xu commented 7 years ago

@amit27kmr worked for me. thx

NileshRamani commented 7 years ago

@amit27kmr worked for me. thanks.

tstasiulionis commented 7 years ago

@MSMcBain this sollution worked!

kallebornemark commented 7 years ago

I've tried both adding "resolutions" to package.json and the npm-shrinkwrap.json solution, neither work. Build server is still getting this error on TeamCity:

[npm install] npm ERR! enoent ENOENT: no such file or directory, chmod '<path on build server>\node_modules\js-beautify\js\bin\css-beautify.js'

romanticlove commented 7 years ago

Guys, you broke the Internet... :(

vivian-xu commented 7 years ago

@kallebornemark you should try this: @amit27kmr

{ 
  "dependencies": 
   { 
     "js-beautify": "1.6.14"
    } 
} 
laxtiz commented 7 years ago

We are fucking!