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

发布时间:2024年01月24日

\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,

文章来源:https://blog.csdn.net/ababab12345/article/details/135818942
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。