首页 > 解决方案 > 如何安装节点 sass?

问题描述

我有节点 - 14.15.4 和 npm - 6.14.10

我正在学习 React,我想使用 reactstrap。但它向我显示了这个错误Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.。所以我试试这个:

npm install --save node-sass@4

现在我有这个错误:

npm WARN bootstrap@4.5.3 requires a peer of jquery@1.9.1 - 3 but none is installed.
You must install peer dependencies yourself.
npm WARN create-react-context@0.3.0 requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. 
You must install peer dependencies yourself.
npm WARN react-popper@1.3.7 requires a peer of react@0.14.x || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.19.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path ..\ReactApp\first_app\my-app\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink '..\ReactApp\first_app\my-app\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink '..\ReactApp\first_app\my-app\node_modules\.node-sass.DELETE\vendor\win32-x64-83\binding.node'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink '..\ReactApp\first_app\my-app\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: '..\\PROJECTS\\ReactApp\\first_app\\my-app\\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: '..\PROJECTS\\ReactApp\\first_app\\my-app\\node_modules\\.node-sass.DELETE\\vendor\\win32-x64-83\\binding.node',
npm ERR!   parent: 'my-app'
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!     ..\AppData\Roaming\npm-cache\_logs\2021-01-12T15_27_11_966Z-debug.log
PS ..\PROJECTS\ReactApp\first_app\my-app> 

标签: reactjsinstallationsass

解决方案


尝试安装“npm install node-sass@4.14.0”


推荐阅读