编译失败:找不到模块

时间:2019-11-18 10:24:54

标签: javascript reactjs

我不确定自己在做什么错,但我不断收到此消息:

Module not found: Can't resolve 'components/List' in 'C:\Users\kobby\Documents\Lambda-School\buildwene\src\coek\hn-clone\src\components\App'

这是在App / index.js中导入的样子:

import React, { Component } from 'react';
import { ThemeProvider } from 'styled-components';
import List from 'components/List';
import { colorsDark } from 'styles/palette';

我的文件夹目录如下: C:\Users\kobby\Documents\Lambda-School\buildweek\hn-clone\src\components\App\index.js

这是List的路径: C:\Users\kobby\Documents\Lambda-School\buildweek\hn-clone\src\components\List

1 个答案:

答案 0 :(得分:0)

路径应如下所示:import List from '../List/index';