Fail to import "BufferGeometryUtils"

I want to use THREE.BufferGeometryUtils, so I wrote the following import.

import {BufferGeometryUtils} from 'three/examples/jsm/utils/BufferGeometryUtils.js';

However, the following error occurs.

TS2305: Module '"three/examples/jsm/utils/BufferGeometryUtils.js"' has no exported member 'BufferGeometryUtils'.
     6 | import * as THREE from 'three';
     7 | import {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader';
  >  8 | import {BufferGeometryUtils} from 'three/examples/jsm/utils/BufferGeometryUtils.js';

I tried “npm install three-buffer-geometry-utils” but the situation remains the same. Please let me know how to solve this problem.

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

up to date, audited 1270 packages in 5s

205 packages are looking for funding   
  run `npm fund` for details

6 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

BufferGeometryUtils
https://unpkg.com/three@0.143.0/examples/jsm/utils/BufferGeometryUtils.js

has the following export:

export {
computeTangents,
computeMikkTSpaceTangents,
mergeBufferGeometries,
mergeBufferAttributes,
interleaveAttributes,
estimateBytesUsed,
mergeVertices,
toTrianglesDrawMode,
computeMorphedAttributes,
mergeGroups
};

so if you need to use a specific function, say computeTangents, you can

import { computeTangents } from 'three/examples/jsm/utils/BufferGeometryUtils.js';

or import everything

import * as BGU from 'three/examples/jsm/utils/BufferGeometryUtils.js';

and then call it l ike so:

BGU.computeTangents();
2 Likes

Thank you very much. Resolved.
Sorry for the elementary question.