Error: Cannot find module 'gulp-sass'

1. 运行gulp报错 Cannot find module 'gulp-sass'

module.js:339  throw err;

Error: Cannot find module 'gulp-sass'

at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (/Applications/XAMPP/xamppfiles/htdocs/flyscoot.com/gulpfile.js:2:12)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)

1.npm update 

2.npm install gulp-sass --save-dev  in your root folder

 

2. 如果报gulp[12560]: c:\ws\src\node_contextify.cc:635: Assertion `args[1]->IsString()' failed.

安装node.js的原生javascript模块 natives

解决:

npm install natives  

 

---------------gulp-------------

//全局gulp

npm install gulp -g

//项目里通过package.json安装指定模块

npm install

 
启动:  gulp watch
 

 

posted @ 2018-03-12 10:32  南侠书生  阅读(1283)  评论(0编辑  收藏  举报