【问题标题】:Assets compiling failed in Laravel 5.4Laravel 5.4 中的资产编译失败
【发布时间】:2018-04-06 10:40:48
【问题描述】:

在 laravel 中编译资产时抛出错误:

ERROR  Failed to compile with 2 errors                                      
error  in ./resources/assets/sass/app.scss
Module build failed: Error: Missing binding /media/xxx/workspace/Projects/Laravel-blog/node_modules/node-sass/vendor/linux-ia32-57/binding.node
Node Sass could not find a binding for your current environment: Linux 32-bit with Node.js 8.x

Found bindings for the following environments:
  - Linux 32-bit with Node.js 7.x

package.json

{
  "private": true,
  "scripts": {
    "dev": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "NODE_ENV=development webpack-dev-server --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "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",
    "bootstrap-sass": "^3.3.7",
    "cross-env": "^3.2.4",
    "jquery": "^3.1.1",
    "laravel-mix": "^1.0",
    "lodash": "^4.17.4",
    "vue": "^2.5.2",
    "webpack": "^3.8.1"
  },
  "dependencies": {
    "bootstrap": "^3.3.7"
  }
}

我认为问题在于错误消息显示的环境绑定。

还有一点要提一下,如果我只编译 js 文件,那么它就是一个成功的构建。我试过 npm rebuild node-sass 但没有帮助。
我该如何解决这个错误?

机器:Ubuntu 16.04
npm -v:5.5.1
节点-v:v8.6.0

【问题讨论】:

    标签: node.js laravel laravel-5 npm


    【解决方案1】:

    当您拥有版本 8 时,绑定正在搜索 Node 版本 7。

    试试下面的命令:

    npm rebuild node-sass
    

    【讨论】:

    • 是的,我试过了,npm rebuild node-sass --force 也试过了,但没有帮助
    猜你喜欢
    • 1970-01-01
    • 2012-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多