Closed DenisCarriere closed 6 months ago
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/denis/.nvm/versions/node/v21.6.2/lib/node_modules/substreams-sink-csv/dist/bin/cli.mjs not supported. 0|substrea | Instead change the require of /Users/denis/.nvm/versions/node/v21.6.2/lib/node_modules/substreams-sink-csv/dist/bin/cli.mjs to a dynamic import() which is available in all CommonJS modules.
Resolved with docs:
pm2
Install pm2
$ npm install -g pm2
$ npm install substreams-sink-csv
ecosystem.config.js
module.exports = {
apps: [{
name: "substreams-sink-csv",
script: "./node_modules/substreams-sink-csv/dist/bin/cli.mjs",
env: {
SUBSTREAMS_API_KEY: '<your-api-key>',
MANIFEST: 'https://github.com/streamingfast/substreams-eth-block-meta/releases/download/v0.5.1/substreams-eth-block-meta-v0.5.1.spkg',
MODULE_NAME: 'graph_out',
SUBSTREAMS_ENDPOINT: 'eth.substreams.pinax.network:443',
FINAL_BLOCKS_ONLY: 'true',
START_BLOCK: '2',
SCHEMA: 'schema.example.sql',
}
}]
}
Start the process
$ pm2 start