错误:要导入的文件未找到或不可读:node_modules / bootstrap-sass / assets / stylesheets / bootstrap

时间:2017-05-06 05:17:17

标签: twitter-bootstrap gulp laravel-elixir

在laravel 5.2.31上安装elixir时出现以下错误

   gulp
[12:05:58] Using gulpfile /var/www/html/ta/gulpfile.js
[12:05:58] Starting 'default'...
[12:05:58] Starting 'sass'...

Fetching Sass Source Files...
   - resources/assets/sass/app.scss


Saving To...
   - public/css/app.css

[12:06:01] Finished 'default' after 2.17 s
[12:06:01] gulp-notify: [Laravel Elixir] Sass Compilation Failed: resources/assets/sass/app.scss
Error: File to import not found or unreadable: node_modules/bootstrap-sass/assets/stylesheets/bootstrap
       Parent style sheet: /var/www/html/ta/resources/assets/sass/app.scss
        on line 1 of resources/assets/sass/app.scss
>> @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
   ^

{ Error: resources/assets/sass/app.scss
Error: File to import not found or unreadable: node_modules/bootstrap-sass/assets/stylesheets/bootstrap
       Parent style sheet: /var/www/html/ta/resources/assets/sass/app.scss
        on line 1 of resources/assets/sass/app.scss
>> @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
   ^

    at options.error (/var/www/html/ta/node_modules/node-sass/lib/index.js:286:26)
  status: 1,
  file: '/var/www/html/ta/resources/assets/sass/app.scss',
  line: 1,
  column: 1,
  message: 'resources/assets/sass/app.scss\nError: File to import not found or unreadable:
     

node_modules /自举-SASS /资产/样式表/引导\ n
  父样式表:/var/www/html/ta/resources/assets/sass/app.scss\   在资源/资产的第1行/ sass / app.scss \ n>> @进口   " node_modules / bootstrap-sass / assets / stylesheets / bootstrap"; \ n ^ \ n',         格式化:'错误:要导入的文件未找到或不可读:node_modules / bootstrap-sass / assets / stylesheets / bootstrap \ n
  父样式表:/var/www/html/ta/resources/assets/sass/app.scss\   在资源/资产的第1行/ sass / app.scss \ n>> @进口   " node_modules / bootstrap-sass / assets / stylesheets / bootstrap"; \ n ^ \ n',         messageFormatted:' \ u001b [4mresources / assets / sass / app.scss \ u001b [24m \ n错误:文件到   导入未找到或不可读:   node_modules /自举萨斯/资产/样式表/引导\ n
  父样式表:/var/www/html/ta/resources/assets/sass/app.scss\   在资源/资产的第1行/ sass / app.scss \ n>> @进口   " node_modules / bootstrap-sass / assets / stylesheets / bootstrap"; \ n ^ \ n',         messageOriginal:'要导入的文件未找到或不可读:node_modules / bootstrap-sass / assets / stylesheets / bootstrap \ nParent style   表:/var/www/html/ta/resources/assets/sass/app.scss',         relativePath:' resources / assets / sass / app.scss',         名称:'错误',         stack:'错误:resources / assets / sass / app.scss \ n错误:要导入的文件未找到或不可读:   node_modules /自举萨斯/资产/样式表/引导\ n
  父样式表:/var/www/html/ta/resources/assets/sass/app.scss\   在资源/资产的第1行/ sass / app.scss \ n>> @进口   " node_modules / bootstrap-sass / assets / stylesheets / bootstrap&#34 ;; \ n ^ \ n \ n   在options.error   (/var/www/html/ta/node_modules/node-sass/lib/index.js:286:26)' ;,         showStack:false,         showProperties:true,         插件:' gulp-sass' }       [12:06:01]完成' sass' 2.24秒后

1 个答案:

答案 0 :(得分:1)

我与Laravel Mix(替换Elixir的服务)有类似的错误:

File to import not found or unreadable: node_modules/bootstrap-sass/assets/stylesheets/bootstrap

我意识到这是因为我忘了在项目目录中运行npm install。你试过了吗?