art-template, node_modules doesn‘t exist or is not a directory

\art-template\lib\runtime.js doesn't exist

Parsed request is a module
using description file: d:\player\package.json (relative path: ./src/template)
  Field 'browser' doesn't contain a valid alias configuration
  resolve as module
    d:\player\src\template\node_modules doesn't exist or is not a directory
    d:\player\src\node_modules doesn't exist or is not a directory
    looking for modules in d:\player\node_modules
      single file module
        No description file found in d:\\node_modules\art-template\lib or above
        no extension
          Field 'browser' doesn't contain a valid alias configuration
          d:\\node_modules\art-template\lib\runtime.js doesn't exist
        .js
          Field 'browser' doesn't contain a valid alias configuration
          d:\\node_modules\art-template\lib\runtime.js.js doesn't exist
        .less
          Field 'browser' doesn't contain a valid alias configuration
          d:\\node_modules\art-template\lib\runtime.js.less doesn't exist
      d:\\node_modules\art-template\lib\runtime.js doesn't exist
    d:\node_modules doesn't exist or is not a directory
    d:\node_modules doesn't exist or is not a directory
    d:\node_modules doesn't exist or is not a directory
    d:\node_modules doesn't exist or is not a directory

解决办法:

修改webpack配置文 webpack\prod.config.js 

resolve: {
        modules: ['node_modules'],
        extensions: ['.js', '.less'],
        fallback: {
            dgram: false,
            fs: false,
            net: false,
            tls: false,
        },
		preferRelative: true,
    },

添加了一行 :preferRelative: true,

相关推荐

  1. ARTS Week 21

    2024-01-25 15:44:03       42 阅读
  2. ARTS Week 23

    2024-01-25 15:44:03       50 阅读
  3. <span style='color:red;'>ARM</span>开发

    ARM开发

    2024-01-25 15:44:03      65 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-25 15:44:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-25 15:44:03       101 阅读
  3. 在Django里面运行非项目文件

    2024-01-25 15:44:03       82 阅读
  4. Python语言-面向对象

    2024-01-25 15:44:03       91 阅读

热门阅读

  1. [Python进阶] Python中使用正则表达式

    2024-01-25 15:44:03       57 阅读
  2. LeetCode解法汇总2865. 美丽塔 I

    2024-01-25 15:44:03       58 阅读
  3. Frida Hook Textview

    2024-01-25 15:44:03       58 阅读
  4. linux 数据包发送介绍

    2024-01-25 15:44:03       47 阅读
  5. docker+selenium+firefox | 我踩过的坑

    2024-01-25 15:44:03       61 阅读