npm/yarn woes


  • And then the murders began.

    Is there any way to get npm or yarn to install just the dependencies of my packages that are dependencies, and the devDependencies of my packages that are devDependencies?

    Asides from the obvious hard disk issues, the dev dependencies for jquery-migrate (specifically, node-gyp) first had issues with our corporate MITM proxy, and then I had to install Microsoft's Visual C++ compiler to get it to work. I just want to use the damn .js file, I don't need any of the dependencies!

    I tried setting NODE_ENV to production, but it ended up failing to download some dependency of either gulp or gulp-sass.



  • ??? npm shouldn't install devDependencies of your dependencies by default. That's exactly what devDependencies are for.


  • SockDev

    @createdtodislikethis said in npm/yarn: don't install devDependencies for my dependencies?:

    ??? npm shouldn't install devDependencies of your dependencies by default. That's exactly what devDependencies are for.

    indeed. if you have modules that need their dev dependencies installed to work they are bad modules and should feel bad. 🙂


  • And then the murders began.

    @createdtodislikethis said in npm/yarn: don't install devDependencies for my dependencies?:

    ??? npm shouldn't install devDependencies of your dependencies by default. That's exactly what devDependencies are for.

    According to the docs, they're only omitted when you tell NPM you're running in production (through environment variable or command-line parameter).

    @accalia said in npm/yarn: don't install devDependencies for my dependencies?:

    if you have modules that need their dev dependencies installed to work they are bad modules and should feel bad. 🙂

    That was what I thought. I will admit that maybe I was doing something wrong - this is only my second project using NPM (and my first using it for front-end dependencies instead of Bower), so I'm hardly an expert.

    Unfortunately at this point, I've installed enough extra crap on my machine that I don't have any good way of knowing if stuff works now because I was doing it wrong, or because I now have several gigs of extra dependencies like C++ compilers and Python 2.7. 😛



  • @unperverted-vixen said in npm/yarn: don't install devDependencies for my dependencies?:

    According to the docs, they're only omitted when you tell NPM you're running in production (through environment variable or command-line parameter).

    That's talking about the modules listed directly for your own package. (Aka the devDependencies you yourself listed in package.json)

    npm should not install devDependencies from packages that are dependencies of your package.


  • And then the murders began.

    @blakeyrat said in Any Gulp experts in the house?:

    NPM ... is ridonkulous

    I'm starting to agree.

    I have a project that started off using NuGet for its front-end dependencies. Those were migrated to Bower, which has been deprecated. So I'm trying to figure out my best way forward.

    • Keep using Bower until I absolutely can't. Given that I check in the JS/CSS we care about, we're not about to get failing builds because of it.

    • Go back to NuGet. Not my favorite option because that only gives me a precompiled version of Bootstrap, and I like the idea of tweaking SASS variables instead of overriding everything by hand.

    • Use Yarn/NPM. Seems to be the industry standard now.

    Unfortunately, at least one package's NPM release (Kendo UI) assumes you're using some sort of bundler that supports JavaScript modules (browserify/webpack). Which... I'm not. Still using System.Web.Optimization for our bundling.

    That may not strictly be NPM's fault, but it's still a PITA.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.