0

试:

new BundleAnalyzerPlugin({
  analyzerMode: "static",
  openAnalyzer: false
})

磁盘写入权限失败,(在禁用模式下相同,使用静态文件)。我正在使用 Ubuntu 18,有没有办法设置软件包,以便它适用于我和任何其他用户?(不管 Op sys?)如果不是,如何解决?

return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open '/report.html'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.writeFileSync (fs.js:1299:33)
    at /home/yaniv/Jeeng-Workspace/sdk/node_modules/webpack-bundle-analyzer/lib/viewer.js:160:8
    at tryHandleCache (/home/yaniv/Jeeng-Workspace/sdk/node_modules/ejs/lib/ejs.js:257:5)
    at Object.exports.renderFile (/home/yaniv/Jeeng-Workspace/sdk/node_modules/ejs/lib/ejs.js:482:10)
    at Object.generateReport (/home/yaniv/Jeeng-Workspace/sdk/node_modules/webpack-bundle-analyzer/lib/viewer.js:149:7)
    at BundleAnalyzerPlugin.generateStaticReport (/home/yaniv/Jeeng-Workspace/sdk/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:149:14)
    at /home/yaniv/Jeeng-Workspace/sdk/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:72:26
    at /home/yaniv/Jeeng-Workspace/sdk/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:80:22
    at Array.forEach (<anonymous>)
    at Immediate._onImmediate (/home/yaniv/Jeeng-Workspace/sdk/node_modules/webpack-bundle-analyzer/lib/BundleAnalyzerPlugin.js:79:21)
    at runCallback (timers.js:794:20)
    at tryOnImmediate (timers.js:752:5)
    at processImmediate [as _immediateCallback] (timers.js:729:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jeeng-sdk@1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jeeng-sdk@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/yaniv/.npm/_logs/2018-07-11T09_14_00_211Z-debug.log
4

1 回答 1

0

必须更改为相对路径“./report.html” :)(所以不要在根 ubuntu 上写)

于 2018-07-20T08:21:34.270 回答