Laravel:无法找到字体依赖项

时间:2017-03-10 13:50:50

标签: laravel npm webpack

我有一个全新安装的Laravel,我无法成功运行npm run dev

  

找不到这些依赖项:

     
      
  • 自举-SASS /资产/字体/引导/ glyphicons-半身-regular.eot   在   ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"precision" ;: 8," outputStyle":"膨胀"" sourceMap":真} ./资源/资产/ SASS / app.scss
  •   
  • 自举-SASS /资产/字体/引导/ glyphicons-半身-regular.woff2   在   ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"precision" ;: 8," outputStyle":"膨胀"" sourceMap":真} ./资源/资产/ SASS / app.scss
  •   
  • 自举-SASS /资产/字体/引导/ glyphicons-半身-regular.woff   在   ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"precision" ;: 8," outputStyle":"膨胀"" sourceMap":真} ./资源/资产/ SASS / app.scss
  •   
  • 自举-SASS /资产/字体/引导/ glyphicons-半身-regular.ttf   在   ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"precision" ;: 8," outputStyle":"膨胀"" sourceMap":真} ./资源/资产/ SASS / app.scss
  •   
  • 自举-SASS /资产/字体/引导/ glyphicons-半身-regular.svg   在   ./~/css-loader!./~/postcss-loader!./~/resolve-url-loader!./~/sass-loader/lib/loader.js?{"precision" ;: 8," outputStyle":"膨胀"" sourceMap":真} ./资源/资产/ SASS / app.scss
  •   

浏览互联网寻找答案,我发现问题#289 on Github,但提出的解决方案并不起作用:

_variables.scss的最后一行:

$icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/";

App.scss:

// Fonts
@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);

// Variables
@import "variables";

// Bootstrap
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";

@import "_app";

我的package.json:

{
  "private": true,
  "scripts": {
    "dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.15.3",
    "babel-core": "^6.23.1",
    "babel-loader": "^6.4.0",
    "babel-preset-env": "^1.2.1",
    "bootstrap-sass": "^3.3.7",
    "cross-env": "^3.2.3",
    "css-loader": "^0.27.1",
    "jquery": "^3.1.1",
    "laravel-mix": "^0.8.8",
    "lodash": "^4.17.4",
    "md5": "^2.2.1",
    "node-sass": "^4.5.0",
    "postcss-loader": "^1.3.3",
    "resolve-url-loader": "^2.0.2",
    "sass-loader": "^6.0.3",
    "style-loader": "^0.13.2",
    "vue": "^2.1.10",
    "webpack": "^2.2.1"
  }
}

有什么想法吗?提前谢谢!

1 个答案:

答案 0 :(得分:0)

我设法通过恢复到以前版本的 package.json 来使其工作。您可以在此处找到它:https://github.com/laravel/laravel/blob/c1643bf0c59b6864fc55e09cce3bfafc67d29e2a/package.json