Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9008137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:52:16+00:00 2026-06-16T01:52:16+00:00

I have an app that I’m deploying to Nodejitsu. Recently, they suffered from npm

  • 0

I have an app that I’m deploying to Nodejitsu. Recently, they suffered from npm issues that caused my app to go offline for several hours after I tried (and failed) to restart it, as its dependencies could not be installed. I was told that this could be averted in the future by listing all of my dependencies as bundledDependencies in my package.json, causing the dependencies to be uploaded along with the rest of the application. Which means that I need my package.json to look something like this:

"dependencies": {
  "express": "2.5.8",
  "mongoose": "2.5.9",
  "stylus": "0.24.0"
},
"bundledDependencies": [
  "express",
  "mongoose",
  "stylus"
]

Now, on DRY grounds, this is unappealing. But what’s worse is the maintenance: Every time I add or remove a dependency, I have to make the change in two places. Is there a command I can use to sync bundledDependencies with dependencies?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:52:17+00:00Added an answer on June 16, 2026 at 1:52 am

    How about implementing a grunt.js task to do it? This works:

    module.exports = function(grunt) {
    
      grunt.registerTask('bundle', 'A task that bundles all dependencies.', function () {
        // "package" is a reserved word so it's abbreviated to "pkg"
        var pkg = grunt.file.readJSON('./package.json');
        // set the bundled dependencies to the keys of the dependencies property
        pkg.bundledDependencies = Object.keys(pkg.dependencies);
        // write back to package.json and indent with two spaces
        grunt.file.write('./package.json', JSON.stringify(pkg, undefined, '  '));
      });
    
    };
    

    Put that in the root directory of your project in a file called grunt.js. To install grunt, use npm: npm install -g grunt. Then bundle the packages by executing grunt bundle.

    A commentor mentioned an npm module that could be useful: https://www.npmjs.com/package/grunt-bundled-dependencies (I haven’t tried it.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that lets the user interact with several forms. I can
I have an App that downloads and displays images from URL's. This works fine
I have an app that received JSON data from the server. Currently when I
I have an app that makes SOAP calls. To keep the UI from blocking,
I have an app that syncs data from a remote DB that users populate.
I have a app that loads some json from my php web service. This
I have an app that allows users to call a phone number from a
I have app that exports data in CSV. Recently I added Open In... feature
I have an app that contains a picture box which updates images from a
I have an app that builds a word document file from a data-set with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.