{"id":25207,"library":"embark-solidity","title":"Embark Solidity","description":"Solidity compiler APIs for the Embark framework (v6.0.0, last stable release April 2020, nightly-only since). Provides programmatic access to solc integration including compilation, version management, and optimizer configuration. Designed for use within Embark's plugin system; requires Embark core and solc. Key differentiator: integrates with Embark's blockchain management, testing, and deployment pipelines. Note: Embark is in maintenance/low-activity mode; consider Hardhat or Foundry for new projects.","status":"maintenance","version":"6.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/embarklabs/embark","tags":["javascript","blockchain","dapps","ethereum","ipfs","serverless","solc","solidity","typescript"],"install":[{"cmd":"npm install embark-solidity","lang":"bash","label":"npm"},{"cmd":"yarn add embark-solidity","lang":"bash","label":"yarn"},{"cmd":"pnpm add embark-solidity","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Solidity compiler binary used for compilation","package":"solc","optional":false},{"reason":"Embark framework core required for plugin lifecycle","package":"@embark/core","optional":true}],"imports":[{"note":"ESM-only; require() will work but is not recommended. Also available as named export.","wrong":"const CompileCommand = require('embark-solidity').CompileCommand","symbol":"CompileCommand","correct":"import { CompileCommand } from 'embark-solidity'"},{"note":"Default export is the plugin function used in Embark configuration.","wrong":"","symbol":"default","correct":"import embarkSolidity from 'embark-solidity'"},{"note":"TypeScript type for the Solc class. Use `import type { Solc } from 'embark-solidity'` for type-only imports.","wrong":"const Solc = require('embark-solidity').Solc","symbol":"Solc","correct":"import { Solc } from 'embark-solidity'"}],"quickstart":{"code":"import { CompileCommand } from 'embark-solidity';\n\nconst compiler = new CompileCommand({\n  contracts: ['MyContract.sol'],\n  solcVersion: '0.8.0',\n  optimizer: { enabled: true, runs: 200 },\n  outputDir: './build/contracts'\n});\n\ncompiler.compile().then(result => {\n  console.log(result.contracts['MyContract.sol']['MyContract'].abi);\n}).catch(err => {\n  console.error('Compilation failed:', err);\n});","lang":"typescript","description":"Shows how to compile a Solidity contract using CompileCommand with version and optimizer settings."},"warnings":[{"fix":"Use Hardhat for Solidity development or Foundry for faster compilation and testing.","message":"Embark framework is in maintenance mode; no active development since v6.0.0 (April 2020). Consider migrating to Hardhat or Foundry.","severity":"deprecated","affected_versions":">=6.0.0"},{"fix":"Use Node.js >=12 and ensure your project is ESM-compatible (e.g., `\"type\": \"module\"` in package.json).","message":"v6.0.0 changed the API to be ESM-only; Node.js <12 will not work without transpilation.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Run `npm install solc` in your project before using embark-solidity.","message":"The package requires `solc` as a peer dependency; not installing it leads to runtime errors.","severity":"gotcha","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install solc: `npm install solc`","cause":"Missing peer dependency `solc`.","error":"Error: Cannot find module 'solc'"},{"fix":"Use `import { CompileCommand } from 'embark-solidity'` instead of `import embarkSolidity from 'embark-solidity'`.","cause":"Default import was used for a named export.","error":"TypeError: embarkSolidity is not a function"},{"fix":"Add `\"type\": \"module\"` to your package.json or use CommonJS require.","cause":"Project is not configured as ESM (e.g., missing `\"type\": \"module\"` in package.json) but using `import`.","error":"SyntaxError: Cannot use import statement outside a module"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}