npm



  • This tool is awful.

    So I'm trying to get our company's front-end app working. It's in angular, and to build it you need a bunch of npm and grunt. Ok fine.

    Supposedly all you need to do is navigate to its root folder and run "npm update -g". Which gets me:

    npm err cb() never called

    Ok, so my co-worker suggests updating Node.JS, so I downloaded the newest installer and ran it. No change.

    So then I found advice online to use "npm cache clear". So I did that. No change.

    So then I found advice online to maniually delete the node_modules folder. So I did that. No change.

    So then I found advice to remove the .npm file and reinstall. Ok, but Windows doesn't have a .npm file in the user profile. It's (correctly for once) placed in AppData. So I look in Roaming AppData and I find two directories:

    1. "npm" which (afaict) contains the stuff that would be in the .npm file/folder if I were on Linux or OS X
    2. "npm_cache", a folder containing 285 MB of shit.

    285 MB of shit.

    In a folder labeled "cache"

    In the Roaming AppData.

    Open source quality.

    Anyway, I removed that, reinstalled Node, and now I'm getting this:

    bower cache clean && bower install

    'bower' is not recognized as an internal or external command,
    operable program or batch file.

    But you know what? I'm ecstatic. Because I actually have a chance of fixing this one.



  • @blakeyrat said:

    This tool is awful.

    So I'm trying to get our company's front-end app working. It's in angular, and to build it you need a bunch of npm and grunt. Ok fine.

    Supposedly all you need to do is navigate to its root folder and run "npm update -g". Which gets me:

    npm err cb() never called

    Ok, so my co-worker suggests updating Node.JS, so I downloaded the newest installer and ran it. No change.

    So then I found advice online to use "npm cache clear". So I did that. No change.

    So then I found advice online to maniually delete the node_modules folder. So I did that. No change.

    So then I found advice to remove the .npm file and reinstall. Ok, but Windows doesn't have a .npm file in the user profile. It's (correctly for once) placed in AppData. So I look in Roaming AppData and I find two directories:

    1. "npm" which (afaict) contains the stuff that would be in the .npm file/folder if I were on Linux or OS X
    2. "npm_cache", a folder containing 285 MB of shit.

    285 of shit.

    In a folder labeled "cache"

    In the Roaming AppData.

    Open source quality.

    Anyway, I removed that, reinstalled Node, and now I'm getting this:

    bower cache clean && bower install

    'bower' is not recognized as an internal or external command,
    operable program or batch file.

    But you know what? I'm ecstatic. Because I actually have a chance of fixing this one.

    All tools are awful till you learn to use them. You are knowing the story of John Henry?



  • @blakeyrat said:

    "npm update -g"

    What you usually want is navigate to your project folder and do npm install. No idea why they made you do that.

    Anyway, your fault for using Windows :)



  • Oh blakey_rat not understanding a tool and then complaining how it caused him some minutes wasted if that. Even though he never obviously read the manual due to the fact it is quite obvious after detailing his route to solving it.


  • Java Dev

    @lucas1 said:

    Oh blakey_rat not understanding a tool and then complaining how it caused him some minutes wasted if that. Even though he never obviously read the manual due to the fact it is quite obvious after detailing his route to solving it.

    Some things never change



  • @PleegWat said:

    @lucas1 said:

    Oh blakey_rat not understanding a tool and then complaining how it caused him some minutes wasted if that. Even though he never obviously read the manual due to the fact it is quite obvious after detailing his route to solving it.

    Some things never change

    The bitch first route is easier for those that aren't talented.



  • @lucas1 said:

    Even though he never obviously read the manual

    Show me the page in the manual that shows how to fix that error. I dare you. I double-dog dare you.



  • @lucas1 Obviously writing a quarter of a gig of data in the Roaming AppData folder is not a bug; if I had read the manual which doesn't exist, that wouldn't happen. Via the mechanism of magic faeries.


  • I survived the hour long Uno hand

    @blakeyrat You're not in the Lounge, so you didn't see my rant a few weeks ago, but npm literally brought down my build server by refusing to ever delete any cached items, ever. It totally filled /tmp with shit it never came back to. We've had to put in a fix where each build overrides the temp directory to /tmp/buildkey and then deletes that folder as it finishes.

    Fuck NPM.


  • BINNED

    @Yamikuronue and Redis, and Mongo, and whatever else. I tried installing shit again today, and once again, following instructions failed. This is available, this is not, this is out of date but it's the newest version in repos...

    As I said, either give me my damned PHP back or document stuff properly. I don't even know how many tools I need and what version they have to be. With freaking PHP, as shit as it is, at least it's always something like "PHP 5.3+, MySQL 5.5+, Apache 2.4+" and you're done. These days I need Node, NPM, Mongo, Redis, bower, grunt, scss, unicorns, rainbows, and a partridge in a pear tree. I JUST WANT TO SERVE SOME HTML!

    Fuck it, I'm going to help @boomzilla keep the kids off his lawn.


  • ♿ (Parody)

    @Onyx said:

    Fuck it, I'm going to help @boomzilla keep the kids off his lawn.

    Hey, I installed all this stuff no problem! I only ran into trouble trying to start it up and configure it.



  • @Onyx the requirements beg to differ

    • A version of Node.js at least 0.10 or greater
    • Redis, version 2.8.9 or greater or MongoDB, version 2.6 or greater


  • @Yamikuronue No, NPM has no bugs that can't be fixed via reading the manual. Don't you see? My eyes have been opened by the wise men in this thread.


  • :belt_onion:

    @blakeyrat :rolleyes:

    To steal @boomzilla's thing


  • BINNED

    @boomzilla I dunno, maybe it's Cloud9 being an ass, or my attempt to install 1.0.1 instead of 1.0.0. Maybe I just should've installed it locally, but I had this silly idea of giving people access to it...

    Also, I need a new VM/VPS, wanted to pay for one but realized that I need to go to the bank to approve my new phone for payments and... bah, I'm just having a shit week I guess.


  • Discourse touched me in a no-no place

    @ben_lubar said:

    A version of Node.js at least 0.10 or greater
    Redis, version 2.8.9 or greater or MongoDB, version 2.6 or greater

    Yeah, nodeBB is a piece of cake to get working.



  • @loopback0 Why is it in my thread?


  • Discourse touched me in a no-no place

    @blakeyrat Ummm... someone posted it?


  • ♿ (Parody)

    @Onyx I created a new Kubuntu 14.04 VM and followed their Ubuntu instructions. I've never used Cloud9, so I can't comment sensibly on that. Instead, in homage to the one who started this topic:

    What the fuck is wrong with developers like you using cloud based crap that doesn't work with open source based crap that's designed not to work‽ You all should feel horrible life quenching shame.



  • Now I got the grunt command to work, I get this:

    Running "jscs:app" (jscs) task
    FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

    There appear to be roughly 587,000 possible causes of this.

    There's one solution that lets you run node.js at a higher memory limit, but I'm not running node, I'm running grunt.


  • Discourse touched me in a no-no place

    Process out of memory? Those are fun to hunt down.

    I suppose it might be worth trying running the code again, see if it fails in the same place or if there's some caching that mitigates things. It probably won't work, but it's easy to try. 😇


  • FoxDev

    @blakeyrat said:

    I'm not running node, I'm running grunt.

    grunt is a node module


  • I survived the hour long Uno hand

    @RaceProUK said:

    grunt is a node module

    Do you know if it lets you pass arguments through to the node process? I took a quick look and couldn't find it.


  • FoxDev

    @Yamikuronue said:

    @blakeyrat You're not in the Lounge, so you didn't see my rant a few weeks ago, but npm literally brought down my build server by refusing to ever delete any cached items, ever. It totally filled /tmp with shit it never came back to. We've had to put in a fix where each build overrides the temp directory to /tmp/buildkey and then deletes that folder as it finishes.

    Fuck NPM.

    i remember that issue.... yeah that was "fun" to find out about.


  • FoxDev

    @Yamikuronue My searching is turning up nada, but there must be a way



  • @RaceProUK said:

    @Yamikuronue My searching is turning up nada, but there must be a way

    How about

    $ node $(which npm)
    

    It's just a node program with a shebang.

    EDIT: Oh sorry, grunt not npm. End of the day brain.



  • @RaceProUK said:

    grunt is a node module

    Which means... what?

    If I use the node.js --more_memory_fucker or whatever it is argument that it'll work on grunt too?



  • Ok so now I have npm and grunt working, so I want to test the app and I type grunt serve --blah and I get it stalled on "ngtemplates". For 5 minutes so far. How long does "ngtemplates" take normally?


  • FoxDev

    @blakeyrat It's a bit of a contortion, but you can do this:
    node --max-stack-size=[size] ./node_modules/.bin/grunt [grunt options]



  • @RaceProUK So the answer is "no." Thanks for your little bit of trivia there about what type of application grunt is, but it turns out I was correct in the first place in assuming the node flag wouldn't work.


  • FoxDev

    @blakeyrat I just gave you the command line to make it work


  • I survived the hour long Uno hand

    @blakeyrat Are your devs using grunt serve for development? Mine use that when they need to compile all their assets, but for dev purposes they just run something like node app\index.js, which means they can use your flags. They also can do nodemon app\index.js so it'll automatically restart when they change files, which is handy.



  • General question: how do I tell if grunt is locked-up or just doing a long-running task with no output?

    It's consuming 13% CPU and 290 MB of my computer, but ain't nothing happened for about 5 minutes. What does that mean?



  • npm was created by people that think that doing everything in javascript is a good idea



  • @Yamikuronue Grunt is producing the out-of-memory error on BUILD, not serve. That's the problem.

    In any case, repeatedly running the grunt command eventually resulted in it working. Because when you're dealing with open source software, determinism is for chumps.



  • @blakeyrat

    Because as per usual you are trying to run before you can walk.

    Bower has to be installed separately as global dependency. npm install -g bower and you are done.

    Who fucking cares there is 300mb of cache, my SSD on this shitty laptop at work has 500GBs. It like the linux devs that complain that VS install is 15gb when even the smallest drives these days are 20 times the



  • @lucas1 said:

    Who fucking cares there is 300mb of cache, my SSD on this shitty laptop at work has 500GBs. It like the linux devs that complain that VS install is 15gb when even the smallest drives these days are 20 times the

    There's a different place where you're supposed to place cache. Placing it in Roaming will sync it with all your devices, some of which might be mobile phones. It's a WTF.

    On the other hand, if Blakey used Mac or Linux, which is probably what his frontend people are doing, none of this would have happened.


  • BINNED

    @cartman82 said:

    On the other hand, if Blakey used Mac or Linux, which is probably what his frontend people are doing, none of this would have happened.

    That's a useless argument: if the front-end devs would have been running Windows it wouldn't have happened either.



  • @Luhmann said:

    That's a useless argument

    Is it? Weren't we just talking about how game developers are correct not to release products on Linux? How it causes all sorts of problems, and caters to a minority of customers?

    Newsflash: these days, Windows is like that for web development.



  • @fbmac

    A lot of the modules you install for node are written in C and C++, thus why you need build essential (on debian based systems) and the VS C++ compiler installed on windows. I have no idea what is needed on MacOSX, I am assuming XCode.


  • FoxDev

    @cartman82 said:

    Newsflash: these days, Windows is like that for web development.

    Unless you're using ASP.NET



  • @cartman82 said:

    @Luhmann said:

    That's a useless argument

    Is it? Weren't we just talking about how game developers are correct not to release products on Linux? How it causes all sorts of problems, and caters to a minority of customers?

    Newsflash: these days, Windows is like that for web development.

    The main problem is the long file path error which is a limitation with legacy Win32 (or something to that effect) rather than Windows itself. However I have run into this problem when people use TFS like retards.

    Usually I install GIT with the GNU tool in path and use CMDER configured to use bash.


  • Discourse touched me in a no-no place

    @lucas1 said:

    I have no idea what is needed on MacOSX, I am assuming XCode.

    Plain old gcc or clang, I'd guess. One of the best things about OSX is that you have no need to do everything by the GUI…


  • FoxDev

    @lucas1 said:

    The main problem is the long file path error which is a limitation with legacy Win32 (or something to that effect) rather than Windows itself.

    Combined with the fact that npm 2 used a way of organising modules that led to very deep hierarchies.

    If you're using a recent enough version of Node (version 5), it uses npm 3, which organises the modules into a much flatter structure, basically avoiding the issue entirely.


  • Discourse touched me in a no-no place

    @Yamikuronue said:

    Fuck NPM

    + ❤



  • @RaceProUK

    I had heard that it would be fixed in npm 3. Since the dailyjs ended ... I seemed to have lost track of the JS world.


  • Discourse touched me in a no-no place

    @lucas1 said:

    Since the dailyjs ended ... I seemed to have lost track of the JS world.

    Daily wouldn't have been frequent enough. We need the minutelyjs…



  • @lucas1 said:

    Who fucking cares there is 300mb of cache,

    It's not the amount that's the problem, it's the location. Stuff in Roaming AppData roams.

    Which is obvious (a heck of a lot more obvious than any of these shitty useless open source tools), but you don't understand the implication. And instead of asking and maybe learning something, you just call me an idiot. Well fuck you.



  • @cartman82 said:

    On the other hand, if Blakey used Mac or Linux, which is probably what his frontend people are doing, none of this would have happened.

    Bullshit. It's the same CLI. I have no reason to believe the experience would be any different, much less better, on OS X.



  • @cartman82 said:

    Is it? Weren't we just talking about how game developers are correct not to release products on Linux? How it causes all sorts of problems, and caters to a minority of customers?

    The problem is none of this shit works, and when it fails (which is inevitably does), there's no fucking error messages.

    The "solution" is a series of magical incantations involving deleting various folders of cached shit.

    It's night-and-day with, say, MSBuild which is reliable like few other pieces of software.


Log in to reply