I am trying to use this library from a Typescript function (running under Node.js 18 environment) deployed as a Firebase function.
Here is what I have (package.json has "music-metadata": "^8.1.4"):
import axios from "axios";
import * as mm from "music-metadata";
const response = await axios.get(urlString, {responseType: "arraybuffer"});
const buffer = Buffer.from(response.data);
const metadata = await mm.parseBuffer(buffer, contentType);
Logger.info(`Parsed audio metadata: ${JSON.stringify(metadata)}`);
TS is failing to compile with:
node_modules/music-metadata/lib/apev2/APEv2Token.d.ts:2:27 - error TS2307: Cannot find module 'strtok3/core' or its corresponding type declarations.
2 import { IGetToken } from 'strtok3/core';
~~~~~~~~~~~~~~
node_modules/music-metadata/lib/core.d.ts:3:26 - error TS2307: Cannot find module 'strtok3/core' or its corresponding type declarations.
3 import * as strtok3 from 'strtok3/core';
~~~~~~~~~~~~~~
node_modules/music-metadata/lib/core.d.ts:5:27 - error TS2307: Cannot find module 'strtok3/core' or its corresponding type declarations.
5 export { IFileInfo } from 'strtok3/core';
~~~~~~~~~~~~~~
[9:18:09 AM] Found 3 errors. Watching for file changes.
Has the question been asked before?
Question
I am trying to use this library from a Typescript function (running under Node.js 18 environment) deployed as a Firebase function.
Here is what I have (
package.json
has"music-metadata": "^8.1.4"
):TS is failing to compile with:
What am I missing?