重新搭建开发环境,运行报错,日志如下:
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1
at module.exports (E:\fsk\fsk-vue-customer\fsk-vue-customer\node_modules\_node-sass@4.14.1@node-sass\lib\binding.js:13:13)
at Object.<anonymous> (E:\fsk\fsk-vue-customer\fsk-vue-customer\node_modules\_node-sass@4.14.1@node-sass\lib\index.js:14:35) at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.sassLoader (E:\fsk\fsk-vue-customer\fsk-vue-customer\node_modules\_sass-loader@7.0.3@sass-loader\lib\loader.js:24:22)
Supported Environments
对比node版本,找到报错原因,node版本过高与当前node-sass不兼容。
C:\Users\Administrator>node -v
v16.14.2
解决方案:重装高版本node-sass或者降低node版本至14以下
我选择重装node-sass,执行 cnpm install –save node-sass,适配版本为node-sass@7.0.1
PS E:\fsk\fsk-vue-customer\fsk-vue-customer> cnpm install –save node-sass
√ Installed 1 packages
√ Linked 138 latest versions
[1/1] scripts.install node-sass@latest run "node scripts/install.js", root: "E:\\fsk\\fsk-vue-customer\\fsk-vue-customer\\node_modules\\_node-sass@7.0.1@node-sass"
Downloading binary from https://cdn.npmmirror.com/binaries/node-sass/v7.0.1/win32-x64-93_binding.node
Download complete
Binary saved to E:\fsk\fsk-vue-customer\fsk-vue-customer\node_modules\_node-sass@7.0.1@node-sass\vendor\win32-x64-93\binding.node
[1/1] scripts.install node-sass@latest finished in 3s
[1/1] scripts.postinstall node-sass@latest run "node scripts/build.js", root: "E:\\fsk\\fsk-vue-customer\\fsk-vue-customer\\node_modules\\_node-sass@7.0.1@node-sass"
Binary found at E:\fsk\fsk-vue-customer\fsk-vue-customer\node_modules\_node-sass@7.0.1@node-sass\vendor\win32-x64-93\binding.node
Testing binary
Binary is fine
[1/1] scripts.postinstall node-sass@latest finished in 410ms
√ Run 1 scripts
√ All packages installed (97 packages installed from npm registry, used 11s(network 8s), speed 382.52KB/s, json 42(151.38KB), tarball 2.66MB, manifests cache hit 96, etag hit 96 / miss 0)
运行成功
原文链接:https://blog.csdn.net/jww_1993/article/details/124371387?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165934461816780357226309%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165934461816780357226309&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-2-124371387-null-null.nonecase&utm_term=%E6%90%AD%E5%BB%BAcdn
原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/6073