1. 程式人生 > >fs包報錯, you can run: npm install --save fs

fs包報錯, you can run: npm install --save fs

bpa back alt font sta immediate fill The node

fs包已安裝,報錯如下:

fs in ./~/[email protected]@vue-server-renderer/build.js, ./~/[email protected]@resolve/lib/sync.js and 10 others

To install it, you can run: npm install --save fs

解決方案:如果在webpack.base.conf.js沒有配置node,可以試試配置一下

node: {

    // prevent webpack from injecting useless setImmediate polyfill because Vue
    // source contains it (although only uses it if it‘s native).
    setImmediate: false,
    // prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client dgram: ‘empty‘, fs: ‘empty‘, net: ‘empty‘, tls: ‘empty‘, child_process: ‘empty‘ }

fs包報錯, you can run: npm install --save fs