1

尝试运行 react-snap 时出现以下错误,我可以看到很多人遇到了类似的问题,但到目前为止我还没有看到解决此问题的解决方案。

它构建到一个名为 dist 的文件夹并删除整个文件夹它仍然会生成此错误

我怎样才能修复这个错误?

 error at /404.html/austrian-cruelty-free-hbo-bag { Error: EEXIST: file already exists, mkdir 'C:\Users\Tom\Desktop\projects\boho\dist\404.html'
    at Object.mkdirSync (fs.js:729:3)
    at sync (C:\Users\Tom\Desktop\projects\boho\node_modules\mkdirp\index.js:71:13)
    at Function.sync (C:\Users\Tom\Desktop\projects\boho\node_modules\mkdirp\index.js:77:24)
    at saveAsHtml (C:\Users\Tom\Desktop\projects\boho\node_modules\react-snap\index.js:565:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  errno: -4075,
  syscall: 'mkdir',
  code: 'EEXIST',
  path: 'C:\\Users\\Tom\\Desktop\\projects\\boho\\dist\\404.html' }

包.json

 "reactSnap": {
    "source": "dist",
    "minifyHtml": {
      "collapseWhitespace": false,
      "removeComments": false
    }
  },

路线

<Switch location={location}>
   <Route exact path="/" render={props =>
      <Home e={e} p={p}
        categories={categories}
        subCategories={subCategories}
        products={products}
        language={language}
        {...props} />} />
        <Route exact path="/delivery" component={Delivery}/>
        <Route exact path="/dostawa" component={Delivery}/>
        <Route exact path="/terms" component={Terms}/>
        <Route exact path="/privacy" component={Privacy}/>
        <Route exact path="/about" component={About}/>
        <Route exact path="/:catId" render={props => <ProductsList  e={e} p={p} categories={categories} subCategories={subCategories} products={products} showAlert={showAlert} language={language} {...props} />} />
        <Route exact path="/:catId/:productId" render={props => <Product categories={categories} subCategories={subCategories} products={products} showAlert={showAlert} language={language} {...props} />} />
  </Switch>
4

0 回答 0