老师我用得就是这个版本
[root@docker1 node_modules]# node -v
v14.17.0
[root@docker1 node_modules]# npm version
{
'mxshop-admin': '1.0.0',
npm: '6.14.13',
ares: '1.17.1',
brotli: '1.0.9',
cldr: '38.1',
icu: '68.2',
llhttp: '2.1.3',
modules: '83',
napi: '8',
nghttp2: '1.42.0',
node: '14.17.0',
openssl: '1.1.1k',
tz: '2020d',
unicode: '13.0',
uv: '1.41.0',
v8: '8.4.371.23-node.63',
zlib: '1.2.11'
}
但是在启动 mall-master 报错了:
[root@docker1 mall-master]# cnpm run dev
> mxshop-admin@1.0.0 dev
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
94% asset optimization
ERROR Failed to compile with 11 errors 上午5:09:59
error in ./src/styles/index.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (/app/bobby/mall-master/node_modules/sass-loader/lib/loader.js:31:19)
@ ./src/styles/index.scss 4:14-203 13:3-17:5 14:22-211
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8090 webpack/hot/dev-server ./src/main.js
我已经安装了了node-sass版本,更新信息如下
[root@docker1 node_modules]# cnpm install node-sass
✔ Installed 1 packages
✔ Linked 219 latest versions
[1/1] scripts.install node-sass@latest run "node scripts/install.js", root: "/app/bobby/mall-master/node_modules/node_modules/_node-sass@7.0.1@node-sass"
Downloading binary from https://cdn.npmmirror.com/binaries/node-sass/v7.0.1/linux-x64-83_binding.node
Download complete
Binary saved to /app/bobby/mall-master/node_modules/node_modules/_node-sass@7.0.1@node-sass/vendor/linux-x64-83/binding.node
Caching binary to /root/.npminstall_tarball/node-sass/7.0.1/linux-x64-83_binding.node
[1/1] scripts.install node-sass@latest finished in 1s
[1/1] scripts.postinstall node-sass@latest run "node scripts/build.js", root: "/app/bobby/mall-master/node_modules/node_modules/_node-sass@7.0.1@node-sass"
Binary found at /app/bobby/mall-master/node_modules/node_modules/_node-sass@7.0.1@node-sass/vendor/linux-x64-83/binding.node
Testing binary
Binary is fine
[1/1] scripts.postinstall node-sass@latest finished in 333ms
✔ Run 1 scripts
deprecate node-sass@7.0.1 › request@^2.88.0 request has been deprecated, see https://github.com/request/request/issues/3142
deprecate node-sass@7.0.1 › request@2.88.2 › har-validator@~5.1.3 this library is no longer supported
deprecate node-sass@7.0.1 › request@2.88.2 › uuid@^3.3.2 Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
✔ All packages installed (243 packages installed from npm registry, used 8s(network 6s), speed 919.64KB/s, json 219(1.01MB), tarball 4.51MB, manifests cache hit 0, etag hit 0 / miss 0)
但是最后还是不行。
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星