fs包报错, you can run: npm install --save fs

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'
}

 

转载于:https://www.cnblogs.com/lixuemin/p/9070946.html

你可能感兴趣的:(fs包报错, you can run: npm install --save fs)