Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 执行npm start时对Css加载程序问题作出反应_Node.js_Reactjs_Ubuntu_Npm Install - Fatal编程技术网

Node.js 执行npm start时对Css加载程序问题作出反应

Node.js 执行npm start时对Css加载程序问题作出反应,node.js,reactjs,ubuntu,npm-install,Node.js,Reactjs,Ubuntu,Npm Install,我在执行NPMStart命令时遇到了问题。我使用的是ubuntu和Node4.2.2版本 ./~/css加载程序!中出错/~/autoprefixer loader?浏览器=最后3个 版本/~/sass加载器?outputStyle=扩展&IncludePath[]=路径/节点\模块/src/styles/index.scss 未找到模块:错误:无法解析“文件”或“目录” ../../assets/fonts/Roboto/Roboto-light.eot在path/src/styles中 我的

我在执行NPMStart命令时遇到了问题。我使用的是ubuntu和Node4.2.2版本

./~/css加载程序!中出错/~/autoprefixer loader?浏览器=最后3个 版本/~/sass加载器?outputStyle=扩展&IncludePath[]=路径/节点\模块/src/styles/index.scss 未找到模块:错误:无法解析“文件”或“目录” ../../assets/fonts/Roboto/Roboto-light.eot在path/src/styles中

我的项目文件结构是

webclient/
   assets/
      fonts/
        Material Icons/
        Roboto/
        RobotoDraft/

安装文件加载器,然后测试

  test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,

  use: [
          {
            loader: 'file-loader',
            options: {
              outputPath: 'fonts/',
              name: '[name][hash].[ext]',
          },
        },
      ],
使用文件加载器,您可以在生成目录中保存字体


你也可以使用url加载器,这样你就可以在构建js文件中内联字体。

你有
。/../assets/fonts/Roboto/light.eot
文件吗?是的,我有../../assets/fonts/Roboto/Roboto-light.eot文件你能用你的文件结构更新这个问题吗?