1

我正在尝试使用 @solana/spl-token lib 来传输令牌,但是当我尝试安装和运行 ng serve 时(使用 Angular 11)。我收到以下错误:

Could not find a declaration file for module 'buffer-layout'. './node_modules/buffer-layout/lib/Layout.js' implicitly has an 'any' type.

Try `npm install @types/buffer-layout` if it exists or add a new declaration (.d.ts) file containing `declare module 'buffer-layout';`

   import {Layout} from 'buffer-layout';

我试图包括

declare module 'buffer-layout';

在 src/index.d.ts 文件中,但它不起作用。

我也得到

 Namespace '"./node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDeclaration'.
    
    7     static ɵfac: i0.ɵɵFactoryDeclaration<ToastContainerDirective, never>;


Cannot use namespace 'Layout' as a type.
    
       export const MintLayout: Layout;

如果有人可以在这里提供帮助,那就太好了。

提前致谢!

4

0 回答 0