beautifier / js-beautify

Beautifier for javascript
https://beautifier.io
MIT License
8.61k stars 1.38k 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.

bramwillemse commented 7 years ago

Same here, we found out in a production release (thanks to npm cache).

+11

hiendv commented 7 years ago

Stop the fucking "+1" without any information.

darren-dev commented 7 years ago

+2

Karimus commented 7 years ago

Confirmed :)

Akiq2016 commented 7 years ago

fuck me

lmj0011 commented 7 years ago

I was getting ready to jump off a cliff before stumbling here. :joy_cat:

natanaelyabes commented 7 years ago

+1

Avien commented 7 years ago

+1

briced commented 7 years ago

Can we please stop posting "+1". It's useless, doesn't help the developer, and spam this issue with non-constructive comments. We're developers, we hate useless bug tickets with no information, let's NOT do the same things to fellow developers.

floriandorre commented 7 years ago

https://github.com/beautify-web/js-beautify/issues/1247#issuecomment-330145596

floriandorre commented 7 years ago

this is the issue (ty @gafung ) :)

hiendv commented 7 years ago

@briced We all know that one guy... 21743186_1094977500632127_3965491206705224243_n

xyxiao001 commented 7 years ago

ahn7 s qg41o eo lf tdsv

abdullah commented 7 years ago

try yarn 👍

lmj0011 commented 7 years ago

try yarn

yarn install

doesn't fix anything for me, probably because I didn't have a yarn.lock file previously

VEMTK commented 7 years ago

we are fucked

abdullah commented 7 years ago

but yarn solved my problem

lmj0011 commented 7 years ago

A stack trace from my webpack config

Module build failed: Error: Cannot find module './lib/beautify'
        at Function.Module._resolveFilename (module.js:470:15)
        at Function.Module._load (module.js:418:25)
        at Module.require (module.js:498:17)
        at require (internal/module.js:20:19)
        at /efs/clientasg12q/lsae/node_modules/js-beautify/js/index.js:74:27
        at Object.<anonymous> (/efs/clientasg12q/lsae/node_modules/js-beautify/js/index.js:80:7)
        at Module._compile (module.js:571:32)
        at Object.Module._extensions..js (module.js:580:10)
        at Module.load (module.js:488:32)
        at tryModuleLoad (module.js:447:12)
        at Function.Module._load (module.js:439:3)
        at Module.require (module.js:498:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (/efs/clientasg12q/lsae/node_modules/vue-loader/lib/template-compiler.js:4:16)
        at Module._compile (module.js:571:32)
        at Object.Module._extensions..js (module.js:580:10)
        at Module.load (module.js:488:32)
        at tryModuleLoad (module.js:447:12)
        at Function.Module._load (module.js:439:3)
        at Module.require (module.js:498:17)
        at require (internal/module.js:20:19)
        at loadLoader (/efs/clientasg12q/lsae/node_modules/loader-runner/lib/loadLoader.js:13:17)
        at iteratePitchingLoaders (/efs/clientasg12q/lsae/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
        at runLoaders (/efs/clientasg12q/lsae/node_modules/loader-runner/lib/LoaderRunner.js:362:2)
        at NormalModule.doBuild (/efs/clientasg12q/lsae/node_modules/webpack/lib/NormalModule.js:182:3)
        at NormalModule.build (/efs/clientasg12q/lsae/node_modules/webpack/lib/NormalModule.js:275:15)
        at Compilation.buildModule (/efs/clientasg12q/lsae/node_modules/webpack/lib/Compilation.js:149:10)
        at factoryCallback (/efs/clientasg12q/lsae/node_modules/webpack/lib/Compilation.js:337:12)
        at factory (/efs/clientasg12q/lsae/node_modules/webpack/lib/NormalModuleFactory.js:241:5)
        at applyPluginsAsyncWaterfall (/efs/clientasg12q/lsae/node_modules/webpack/lib/NormalModuleFactory.js:94:13)
briced commented 7 years ago

@abdullah Do you have a yarn.lock file in your project? If you do, yarn use this file to get the locked versions of your dependencies, so you don't download the last (broken) version.

YanlongLi commented 7 years ago

me too, same problem

lmj0011 commented 7 years ago

@abdullah Do you have a yarn.lock file in your project? If you do, yarn use this file to get the locked versions of your dependencies, so you don't download the last (broken) version.

guess I'll be switching to yarn for good after this mess is fixed.

ghost commented 7 years ago

In a laravel-mix and vue environment (maybe other setups too) easy fix can be:

npm install --save-dev js-beautify@1.6.14

Building now works for me.

briced commented 7 years ago

npm 5 (bundled with node 8) generate a package-lock.json and do the same version-locking system.

lmj0011 commented 7 years ago

npm 5 (bundled with node 8) generate a package-lock.json and do the same version-locking system.

Alright, cool.

Martian1937 commented 7 years ago

+1

mahnunchik commented 7 years ago
npm ERR! Linux 4.4.0-93-generic
npm ERR! argv "/.nvm/versions/node/v6.11.3/bin/node" "/.nvm/versions/node/v6.11.3/bin/npm" "i"
npm ERR! node v6.11.3
npm ERR! npm  v3.10.10
npm ERR! path /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 '/js-beautify/js/bin/css-beautify.js'
npm ERR! enoent ENOENT: no such file or directory, chmod '/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 
mgleon08 commented 7 years ago

Can fix this problem now!!

npm install js-beautify@1.6.14
arkolesen commented 7 years ago

Nice monday, guys :D

cuitianze commented 7 years ago

+10086

lmj0011 commented 7 years ago

https://github.com/beautify-web/js-beautify/issues/1247#issuecomment-330162127

That's a workaround.

TatChu commented 7 years ago

for work now npm install --save-dev js-beautify@1.6.14

TheCrookedMan commented 7 years ago

me 2!

d3radicated commented 7 years ago

npm: npm install --save-dev js-beautify@1.6.14 yarn: yarn add js-beautify@1.6.14 --dev

Add this to your package.json file:

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

+2

abdullah commented 7 years ago

+3

differui commented 7 years ago
  "bin": {
    "css-beautify": "./js/bin/css-beautify.js",
    "html-beautify": "./js/bin/html-beautify.js",
    "js-beautify": "./js/bin/js-beautify.js"
  },

These three JS files not exist in 1.7.0 released pkg.

lmj0011 commented 7 years ago

https://github.com/beautify-web/js-beautify/issues/1247#issuecomment-330165554

These three JS files not exist in 1.7.0 released pkg.

Now we're getting somewhere. :thinking:

LinusBorg commented 7 years ago

Someone please delete every instance of +1 and those rude comments in this thread. People seem to have no manners anymore ...

bbosiljcic commented 7 years ago

@LinusBorg, I kinda enjoy the show :popcorn:

fatihacet commented 7 years ago

If you have problem with running your vue-cli project npm install js-beautify@1.6.14 fixed the problem for me.

jurerick commented 7 years ago

Im fuck today of this

tstasiulionis commented 7 years ago

Same here, but then how do I start the npm run dev it gives the log of:

> cross-env NODE_ENV=development webpack-dev-server --open --inline --hot

sh: cross-env: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! vue-cli@ dev: `cross-env NODE_ENV=development webpack-dev-server --open --inline --hot`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the vue-cli@ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gsm/.npm/_logs/2017-09-18T09_18_56_345Z-debug.log
huysh3 commented 7 years ago

npm install -g vue-cli --registry=https://registry.npm.taobao.org can resolve for now

moonfruit commented 7 years ago

+1

wssgcg1213 commented 7 years ago

+1

enolgor commented 7 years ago

+1

cocochepeau commented 7 years ago

Guys.. "plus ones" are so annoying and useless.

Again, just use the previous tag until this gets fixed.

dumptyd commented 7 years ago

vue-loader is fucked. I wasted 40 minutes thinking something was wrong with my webpack config.

tstasiulionis commented 7 years ago

What is a work around to start a vue-cli dev server, with npm run dev?

mylesan commented 7 years ago

We are fucked