首页 > 解决方案 > 无法安装 sass

问题描述

我尝试安装 node-sass 并且它可以工作,但是 main.scss 中的代码不会自动传输到 style.css 中,然后我删除了包括 package.scss 在内的所有文件并尝试重新安装 node-sass,但我得到了这些错误。

PS D:\web course\iti\bootstrap\sass> npm install node-sass
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: 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.
npm WARN sass@1.0.0 No description
npm WARN sass@1.0.0 No repository field.

npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path D:\web course\iti\bootstrap\sass\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\web course\iti\bootstrap\sass\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'D:\web course\iti\bootstrap\sass\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'D:\web course\iti\bootstrap\sass\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'D:\\web course\\iti\\bootstrap\\sass\\node_modules\\.node-sass.DELETE\\vendor\\win32-x64-83\\binding.node'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'D:\\web course\\iti\\bootstrap\\sass\\node_modules\\.node-sass.DELETE\\vendor\\win32-x64-83\\binding.node',
npm ERR!   parent: 'sass'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\TECH VALLEY\AppData\Roaming\npm-cache\_logs\2021-08-11T14_25_50_073Z-debug.log
PS D:\web course\iti\bootstrap\sass>

标签: cssnode.jsnpmsassnode-sass

解决方案


尝试 npm uninstall node-sass 然后再次安装


推荐阅读