更新 npm 后,node_modules 出现错误?

这是我更新 npm 后遇到的错误,由于出现 [WDS] Disconnected 错误!Mozilla Firefox 控制台中出现错误。这是有经验的开发人员需要解决的错误。



5 import firebase from 'firebase/app';

         ~~~~~~~~


  node_modules/firebase/index.d.ts:9710:1

    9710 export = firebase;

         ~~~~~~~~~~~~~~~~~~

    This module is declared with using 'export =', and can only be used with a default import when using the

'allowSyntheticDefaultImports' flag.

node_modules/@angular/fire/firestore/collection-group/collection-group.d.ts:2:8 - error TS1259: Module '"D:/apps/angularfs3/node_modules/firebase/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag


2 import firebase from 'firebase/app';

         ~~~~~~~~


  node_modules/firebase/index.d.ts:9710:1

    9710 export = firebase;

         ~~~~~~~~~~~~~~~~~~

    This module is declared with using 'export =', and can only be used with a default import when using the

'allowSyntheticDefaultImports' flag.

node_modules/@angular/fire/firestore/firestore.d.ts:9:8 - error TS1259: Module '"D:/apps/angularfs3/node_modules/firebase/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag


9 import firebase from 'firebase/app';

         ~~~~~~~~


  node_modules/firebase/index.d.ts:9710:1

    9710 export = firebase;

         ~~~~~~~~~~~~~~~~~~

    This module is declared with using 'export =', and can only be used with a default import when using the

'allowSyntheticDefaultImports' flag.

node_modules/@angular/fire/auth/auth.d.ts:4:8 - error TS1259: Module '"D:/apps/angularfs3/node_modules/firebase/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag


4 import firebase from 'firebase/app';

         ~~~~~~~~



一只名叫tom的猫
浏览 85回答 1
1回答

HUWWW

您需要添加"allowSyntheticDefaultImports": true您的tsconfig.json(compilerOptions部分)。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript