Javascript 未处理的拒绝错误:路径无效

Javascript 未处理的拒绝错误:路径无效,javascript,reactjs,Javascript,Reactjs,当我npm运行devreact项目时,它会遇到如下错误: Unhandled rejection Error: Invalid path './dist/' path: require("path").resolve("./dist") 有人告诉我应该尝试一条绝对路径,但错误再次出现 Unhandled rejection Error: Invalid path '/path/to/dist/' 我很困惑~有人遇到过这个问题吗 const output = { path: './dis

当我
npm运行dev
react项目时,它会遇到如下错误:

Unhandled rejection Error: Invalid path './dist/'
path: require("path").resolve("./dist")
有人告诉我应该尝试一条绝对路径,但错误再次出现

Unhandled rejection Error: Invalid path '/path/to/dist/'
我很困惑~有人遇到过这个问题吗

const output = {
  path: './dist/',
  filename: 'bundle.js',
  publicPath: '../'
};

我认为,问题可能出在你的道路上。作为一种解决方法,您可以尝试以下方法:

Unhandled rejection Error: Invalid path './dist/'
path: require("path").resolve("./dist")
另外,从错误消息中,我认为您使用的绝对路径不起作用,因为它还有一个前导