tmont / tail-stack-events

CLI script for tailing AWS CloudFormation stack events
20 stars 3 forks source link

Error: Cannot find module '@aws-sdk/client-cloudformation' #7

Closed iainelder closed 3 years ago

iainelder commented 3 years ago

I've tried installing tail-stack-events and its peer dependency aws-sdk and it's still failing.

I'm very new to the whole npm thing. Any idea where I'm going wrong?

Terminal output below:

$ npm install -g tail-stack-events
/home/isme/.npm-packages/bin/tail-stack-events -> /home/isme/.npm-packages/lib/node_modules/tail-stack-events/tail-stack-events.js
npm WARN tail-stack-events@2.1.0 requires a peer of @aws-sdk/client-cloudformation@3.x but none is installed. You must install peer dependencies yourself.

+ tail-stack-events@2.1.0
added 1 package in 1.915s
$ tail-stack-events
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '@aws-sdk/client-cloudformation'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/isme/.npm-packages/lib/node_modules/tail-stack-events/tail-stack-events.js:4:24)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
$ npm install -g aws-sdk

> aws-sdk@2.940.0 postinstall /home/isme/.npm-packages/lib/node_modules/aws-sdk
> node scripts/check-node-version.js

+ aws-sdk@2.940.0
added 14 packages from 66 contributors in 2.941s
$ tail-stack-events
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '@aws-sdk/client-cloudformation'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/isme/.npm-packages/lib/node_modules/tail-stack-events/tail-stack-events.js:4:24)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
tmont commented 3 years ago

You need to run npm install -g @aws-sdk/client-cloudformation. You were installing the old monolithic aws-sdk package, not the newer incarnation which has each service in a separate package under the @aws-sdk namespace.