%1 is not a valid Win32 application

希望能帮助到你, 怕你着急!

 

先看解决步骤, 然后在看描述

1
2
npm rm node-sass
npm install node-sass

  

重新安装node-sass模块

 /*************************************************************************************/

当我搭建一个新的前端开发框架时,  使用gulp-sass编译scss文件,   gulpfile 里是这样写的;

 

复制代码
var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('sass', function () {
    return gulp.src('css/*.scss', opt)
        .pipe(sass().on('error', sass.logError))
        .pipe(gulp.dest(dist));
});
复制代码

 

运行 gulp sass 命令后 报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
F:\study\studyGulp>gulp sass
(node:8488) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
module.js:568
   return  process.dlopen(module, path._makeLong(filename));
                  ^
 
Error: %1 is not a valid Win32 application.
\\?\F:\study\studyGulp\node_modules\node-sass\vendor\win32-x64-48\binding.node
     at Error (native)
     at Object.Module._extensions..node (module.js:568:18)
     at Module.load (module.js:458:32)
     at tryModuleLoad (module.js:417:12)
     at Function.Module._load (module.js:409:3)
     at Module.require (module.js:468:17)
     at require (internal/module.js:20:19)
     at Object.<anonymous> (F:\study\studyGulp\node_modules\node-sass\lib\index.js:24:15)
     at Module._compile (module.js:541:32)
     at Object.Module._extensions..js (module.js:550:10)

  

1
<span style= "font-size: 16px;" ><strong>%1 is not a valid Win32 application</strong></span>

莫名其妙的错误, 代码里没有任何 1% 啊; 

最后在github issues 里找到了答案   链接  https://github.com/sass/node-sass/issues/468 

 

解决步骤如下

1
2
npm rm node-sass
npm install node-sass

 

重新安装 node-sass模块

 

然后编译完美运行, over  

猜你喜欢

转载自blog.csdn.net/zb0567/article/details/77944421