oracle/oci-typescript-sdk

Error: Cannot find module 'bunyan'

Closed this issue · 7 comments

npm install oci-objectstorage

import the module somewhere

import { ObjectStorageClient } from 'oci-objectstorage';

run the application

Error: Cannot find module 'bunyan'
Require stack:
- ***/node_modules/oci-common/lib/log.js
- ***/node_modules/oci-common/lib/retrier.js
- ***/node_modules/oci-common/lib/circuit-breaker.js
- ***/node_modules/oci-common/lib/utils.js
- ***/node_modules/oci-common/lib/headers.js
- ***/node_modules/oci-common/lib/helper.js
- ***/node_modules/oci-common/lib/signer.js
- ***/node_modules/oci-common/index.js
- ***/node_modules/oci-objectstorage/lib/client.js
- ***/node_modules/oci-objectstorage/index.js
...

@slia-stryber Can you try running npm install bunyan ? That should solve the issue for now. However we will take a look internally as why bunyan logger is being used in the objectstorage client.

@slia-stryber Can you try running npm install bunyan ? That should solve the issue for now. However we will take a look internally as why bunyan logger is being used in the objectstorage client.

Yes, definitely, but I belive that

"bunyan": "^1.8.15",

should be somewhere in the package.json.

Also I don't have USE_BUNYAN env variable.

Yes thats correct. But we do not use Bunyan logger in the clients. if its is giving an error for missing module bunyan, the issue is not that module is missing from package.json but it should not have been used in the client in the first place. We will look in to it as why it's complaining for bunyan.

Yes thats correct. But we do not use Bunyan logger in the clients. if its is giving an error for missing module bunyan, the issue is not that module is missing from package.json but it should not have been used in the client in the first place. We will look in to it as why it's complaining for bunyan.

import * as bunyan from "bunyan";

This problem comes with version 2.79.1. As a workaround, I downgraded to 2.79.0, and the problem went away. It affects other modules, too, at least oci-common and oci-identity, but probably any of them.

Hi @vpeltola This issue has been fixed in the latest release. Can you please upgrade the sdk version ot the latest and confirm it works for you?

Closing this issue as it is fixed with latest release . @vpeltola please feel free to reopen if incase you are still seeing this issue. Thanks !