![](/img/trans.png)
[英]Trying to use jest with create-react-app and typescript. Get error: Jest: Failed to parse the TypeScript config file... Cannot find module 'ts-node'
[英]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.