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

Posted 简惬

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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‘
}

 

以上是关于fs包报错, you can run: npm install --save fs的主要内容,如果未能解决你的问题,请参考以下文章

Vue中引入swiper插件报错:To install it, you can run: npm install --save swiper/css/swiper.css

To install them, you can run: npm install --save core-js/modules/es6.array报错解决办法

To install them, you can run: npm install --save core-js/modules/es6.array报错解决办法

you can run: npm install --save core-js/modules/es.regexp.exec core-js/modules/es.string.replace(已解决

Error:To install them, you can run: npm install --save vue-style-loader css-loader……

Error:To install them, you can run: npm install --save vue-style-loader css-loader……