gulp watch启动项目是报错;Cannot find module 'gulp-sass'
E:\workIdap\idap\src\main\resources>gulp watch
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'gulp-sass'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (E:\workIdap\idap\src\main\resources\gulpfile.js:11:12
)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
E:\workIdap\idap\src\main\resources>
使用了一下解决方案
解决办法一
1.npm update
2.npm install gulp-sass --save-dev 此方法无效
解决办法二
1.在项目目录cmd下运行 npm install -g cnpm --registry=https://registry.npm.taobao.org
2.下载成功后再运行 cnpm install node-sass 无效
解决方法三
1)npm -v
2)npm i npm check updates g
3)npm i npm check updates
4)npm i -g gulp
5)npm install gulp-sass --save-dev