react-snap 404.html文件存在

时间:2019-11-13 13:35:36

标签: javascript reactjs react-snap

尝试运行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' }

package.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>

0 个答案:

没有答案