老师 为什么我一加 lang = 'stylus' 就报错啊

来源:7-1 Vue项目首页 - header区域开发

慕尼黑1446479

2021-01-21

WAIT Compiling… 下午8:13:16

57% building modules 4/5 modules 1 active …\src\pages\home\components\Header.vue(node:9836) UnhandledPromiseRejectionWarning: TypeError: loaderContext.getResolve is not a function
at createEvaluator (D:\project\travel\node_modules\stylus-loader\dist\utils.js:276:37)
at Object.stylusLoader (D:\project\travel\node_modules\stylus-loader\dist\index.js:107:60)
at LOADER_EXECUTION (D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
at runSyncOrAsync (D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
at iterateNormalLoaders (D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at iterateNormalLoaders (D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
at D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:236:3
at Object.context.callback (D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at Object.module.exports (D:\project\travel\node_modules\vue-loader\lib\selector.js:21:8)
at LOADER_EXECUTION (D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
at runSyncOrAsync (D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
at iterateNormalLoaders (D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at D:\project\travel\node_modules\loader-runner\lib\LoaderRunner.js:205:4
at D:\project\travel\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:70:14
at processTicksAndRejections (internal/process/task_queues.js:75:11)
(Use node --trace-warnings ... to show where the warning was created)
(node:9836) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:9836) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我的stylus装好了呀:我在cmd输入 这个 :stylus -h
返回这个:
Usage: stylus [options] [command] [< in [> out]]
[file|dir …]

Commands:

help [<type>:]<prop> Opens help info at MDN for <prop> in
                     your default browser. Optionally
                     searches other resources of <type>:
                     safari opera w3c ms caniuse quirksmode

Options:

-i, --interactive       Start interactive REPL
-u, --use <path>        Utilize the Stylus plugin at <path>
-U, --inline            Utilize image inlining via data URI support
-w, --watch             Watch file(s) for changes and re-compile
-o, --out <dir>         Output to <dir> when passing files
-C, --css <src> [dest]  Convert CSS input to Stylus
-I, --include <path>    Add <path> to lookup paths
-c, --compress          Compress CSS output
-d, --compare           Display input along with output
-f, --firebug           Emits debug infos in the generated CSS that
                        can be used by the FireStylus Firebug plugin
-l, --line-numbers      Emits comments in the generated CSS
                        indicating the corresponding Stylus line
-m, --sourcemap         Generates a sourcemap in sourcemaps v3 format
-q, --quiet                                  Less noisy output
--sourcemap-inline      Inlines sourcemap with full source text in base64 format
--sourcemap-root <url>  "sourceRoot" property of the generated sourcemap
--sourcemap-base <path> Base <path> from which sourcemap and all sources are relative
-P, --prefix [prefix]   prefix all css classes
-p, --print             Print out the compiled CSS
--import <file>         Import stylus <file>
--include-css           Include regular CSS on @import
     --ext                   Specify custom file extension for compiled file, default .css
-D, --deps              Display dependencies of the compiled file
--disable-cache         Disable caching
--hoist-atrules         Move @import and @charset to the top
-r, --resolve-url       Resolve relative urls inside imports
--resolve-url-nocheck   Like --resolve-url but without file existence check
-V, --version           Display the version of Stylus
-h, --help              Display help information
写回答

1回答

Dell

2021-01-21

npm install stylus@0.54.5  --save

npm install stylus-loader@3.0.1 --save


0
0

Vue2.5-2.6-3.0开发去哪儿网App 零基础入门到实战

课程紧跟Vue3版本迭代,企业主流版本Vue2+Vue3全掌握

10730 学习 · 8205 问题

查看课程