Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
azurite
✓ N/A (run as CLI)
✗ import { azurite } from 'azurite'
Azurite is primarily a command-line tool and server. It is not designed for direct programmatic import as a library within a Node.js application. To use it programmatically, spawn the 'azurite' executable as a child process.
AzuriteServer
✓ N/A (no public API)
✗ import { AzuriteServer } from 'azurite'
Azurite does not expose a direct class or function for in-process server instantiation. It runs as an independent executable managed via CLI or Docker.
BlobServiceClient
✓ N/A (use @azure/storage-blob)
✗ import { BlobServiceClient } from 'azurite'
While Azurite emulates Azure Storage, client SDKs (like BlobServiceClient for interacting with Blob storage) are provided by the official Azure SDKs (e.g., `@azure/storage-blob`), not Azurite itself.
Demonstrates how to programmatically start the Azurite local Azure Storage emulator server using Node.js `child_process`, configure its listening ports, data persistence, and disable telemetry, then listen for its output.
import { spawn } from 'child_process';
import path from 'path';
async function startAzuriteProgrammatically() {
// Determine the Azurite command. Assumes global installation or local in node_modules/.bin
const azuriteCommand = process.platform === 'win32'
? path.join(process.cwd(), 'node_modules', '.bin', 'azurite.cmd')
: path.join(process.cwd(), 'node_modules', '.bin', 'azurite');
// Fallback to global command if local not found (or if installed globally)
const commandToExecute = require('which').sync(azuriteCommand, { nothrow: true }) || 'azurite';
const azuriteProcess = spawn(commandToExecute, [
'--blob', 'http://127.0.0.1:10000',
'--queue', 'http://127.0.0.1:10001',
'--table', 'http://127.0.0.1:10002',
'--location', './azurite_data', // Persist data to a local directory
'--debug', './azurite_debug.log', // Log debug info to a file
'--silent', // Suppress console output from Azurite itself
'--disableTelemetry' // Opt-out of telemetry data collection
]);
azuriteProcess.stdout.on('data', (data) => {
console.log(`Azurite stdout: ${data.toString()}`);
});
azuriteProcess.stderr.on('data', (data) => {
console.error(`Azurite stderr: ${data.toString()}`);
});
azuriteProcess.on('error', (err) => {
console.error(`Failed to start Azurite process: ${err.message}`);
});
azuriteProcess.on('close', (code) => {
console.log(`Azurite process exited with code ${code}`);
});
console.log('Attempting to start Azurite. Waiting for services to become available...');
await new Promise(resolve => setTimeout(resolve, 8000)); // Give Azurite time to start
console.log('Azurite should be running on Blob (10000), Queue (10001), Table (10002).');
console.log('Data will be persisted in ./azurite_data and debug logs in ./azurite_debug.log.');
// To stop Azurite, you would typically use azuriteProcess.kill(); in a real application
// For this quickstart, it will run until the Node.js script exits.
}
// You might need to 'npm install -g azurite' or 'npm install which' for this to run reliably.
// For local install: 'npm install azurite'
startAzuriteProgrammatically().catch(console.error);
azurite --version
Errors
Common errors & fixes
HTTP 400 One of the request inputs is not valid or similar errors when submitting batch requests.
An issue with HTTP header parsing in `SubmitBatch()` operations when a HTTP header value contained the HTTP header delimiter (`:`).
fixThis issue was resolved in Azurite v3.30.0. Update your Azurite instance to at least version 3.30.0 to fix batch request parsing.
All subsequent requests failing with a 500 error after a client prematurely disconnects.
An internal Azurite issue where premature client disconnections could lead to all following requests from any client failing with a 500 server error.
fixThis problem was fixed in Azurite v3.32.0. Upgrade your Azurite instance to version 3.32.0 or newer to prevent this cascading error state.
Failure to delete a container after it was created with a blob, then deleted, and then recreated with the same name and a blob.
An issue specific to SQL-backed persistence where container deletion was not fully reconciled, leading to conflicts on subsequent operations with the same name.
fixThis persistence logic bug was fixed in Azurite v3.35.0. Update your Azurite instance to at least version 3.35.0.
Error: Cannot find module 'azurite' or similar module resolution failures when attempting to `import` or `require` Azurite.
Azurite is distributed as a command-line executable and a server, not a JavaScript library designed for direct programmatic imports into application code.
fixDo not attempt to `import` or `require` Azurite directly. Instead, run Azurite as a separate process (e.g., via `child_process.spawn`) or as a Docker container, and then interact with its HTTP endpoints using standard Azure Storage SDKs.
Audit
Dependencies
mysql2optionalUsed for metadata storage when configured to use an external database; security patches were applied in v3.32.0.