大家好!来自github ecom的项目已克隆并安装在我的本地服务器上, 项目正在运行,但是当我通过cli npm输入时,watch会显示这样的错误。
ERROR in ./node_modules/css-loader?{"url":true,"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"sourceMap":true,"ident":"postcss","plugins":[null]}!./node_modules/resolve-url-loader?{"sourceMap":true,"root":"C://xampp//htdocs//ecom//node_modules"}!./node_modules/sass-loader/lib/loader.js?{"precision":8,"outputStyle":"expanded","sourceMap":true}!./resources/assets/sass/app.scss
Module build failed: Error: Cannot find module 'node-sass'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\xampp\htdocs\ecom\node_modules\sass-loader\lib\loader.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at loadLoader (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\loadLoader.js:13:17)
at iteratePitchingLoaders (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
at iteratePitchingLoaders (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
at C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:173:18
at loadLoader (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\loadLoader.js:36:3)
at iteratePitchingLoaders (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
at iteratePitchingLoaders (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
at C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:173:18
at loadLoader (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\loadLoader.js:36:3)
at iteratePitchingLoaders (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
at iteratePitchingLoaders (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
at C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:173:18
at loadLoader (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\loadLoader.js:36:3)
at iteratePitchingLoaders (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
at runLoaders (C:\xampp\htdocs\ecom\node_modules\loader-runner\lib\LoaderRunner.js:362:2)
at NormalModule.doBuild (C:\xampp\htdocs\ecom\node_modules\webpack\lib\NormalModule.js:182:3)
at NormalModule.build (C:\xampp\htdocs\ecom\node_modules\webpack\lib\NormalModule.js:275:15)
at Compilation.buildModule (C:\xampp\htdocs\ecom\node_modules\webpack\lib\Compilation.js:151:10)
@ ./resources/assets/sass/app.scss 4:14-266
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
请帮助我...
答案 0 :(得分:0)
尝试一下,然后再次编译:
npm install node-sass --save