簡體   English   中英

如何修復打字稿中的node-config錯誤?

[英]How repair error for node-config in typescript?

安裝node-config和@ types / config后:

npm install config
npm install @types/config

當我嘗試在我的應用中使用時:

import config from 'config';

我收到錯誤消息:

Module not found: Error: Can't resolve 'fs'

我安裝了'fs'模塊,但仍然收到此錯誤。

Module not found: Error: Can't resolve 'fs'

聽起來您正在嘗試在fs模塊不可用的前端代碼或React Native中使用node-config [不支持]) https://github.com/lorenwest/node-config/issues/367 )。

應該沒有需要安裝的fs當使用模塊node-config與Node.js--的fs模塊內置到Node.js的

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM