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

fs包已安装,报错如下:

fs in ./~/_vue-server-renderer@2.5.16@vue-server-renderer/build.js, ./~/_resolve@1.7.1@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'
}

 

posted @ 2018-05-22 10:59  简惬  阅读(4150)  评论(0编辑  收藏  举报