【问题标题】:npm install --save fs - package not being found once installednpm install --save fs - 安装后找不到包
【发布时间】:2020-12-29 15:31:17
【问题描述】:

当我尝试通过yarn run dev 为我的 SSR Nuxt 应用程序运行构建时,我收到以下 错误 消息:

This dependency was not found:                                                                                                                                                                 
                                                                                                                                                                                               
* fs in ./node_modules/json5/lib/register.js                                                                                                                                                   
                                                                                                                                                                                               
To install it, you can run: npm install --save fs 

一旦我执行npm install --save fsyarn add fs 我仍然得到错误

如何获取要构建的代码?

【问题讨论】:

    标签: node.js npm nuxt.js


    【解决方案1】:

    将以下内容添加到 Nuxt.config.js 允许构建通过:

    extend (config, {isDev, isClient}) {
      config.node = {
        fs: 'empty'
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2019-05-09
      • 2016-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-16
      • 2022-01-06
      • 2020-09-25
      相关资源
      最近更新 更多