Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'strtok3/core' or its corresponding type declarations #1708

Closed
1 task done
arnab opened this issue May 20, 2023 · 2 comments
Closed
1 task done

Comments

@arnab
Copy link

arnab commented May 20, 2023

Has the question been asked before?

  • I have searched the existing issues

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"):

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.

What am I missing?

@arnab arnab added the question Question, clarification, discussion label May 20, 2023
@arnab
Copy link
Author

arnab commented May 20, 2023

This error goes away if I use the last major version of this library:

"music-metadata": "^7.13.4"

Is there something I need to do to use the latest 8.x version in a TS/Node.js 18 environment?

@Borewit Borewit added duplicate and removed question Question, clarification, discussion labels May 23, 2023
@Borewit
Copy link
Owner

Borewit commented May 23, 2023

Duplicate of #1373

@Borewit Borewit marked this as a duplicate of #1373 May 23, 2023
@Borewit Borewit closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants