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,

你可能感兴趣的:(node.js,nodejs,HTML5技术,javascript,art-template,webpack)