首页 > 解决方案 > 安装节点 sass 给出错误消息

问题描述

我正在使用 Visual Studio 代码,我需要在我的机器上安装 sass。我尝试执行以下 PowerShell 命令:npm install node-sass 和 npm install -g node-sass,但两者都不起作用。

当我在 Visual Studio 代码中构建时,我收到以下错误消息:

 node-sass : The term 'node-sass' is not recognized as the name of a
 cmdlet, function, script file, or operable program. Check the spelling
 of the name, or if a path was included, verify that the path is
 correct and try again. At line:1 char:1
 + node-sass nbt.scss nbt.css
 + ~~~~~~~~~
     + CategoryInfo          : ObjectNotFound: (node-sass:String) [], CommandNotFoundException
     + FullyQualifiedErrorId : CommandNotFoundException

powershell 命令的输出是:

PS C:\WINDOWS\system32> npm install -g node-sass
C:\Users\Peter\AppData\Roaming\npm\node-sass -> C:\Users\Peter\AppData\Roaming\npm\node_modules\node-sass\bin\node-sass

> node-sass@4.13.1 install C:\Users\Peter\AppData\Roaming\npm\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\Peter\AppData\Roaming\npm-cache\node-sass\4.13.1\win32-x64-64_binding.node

> node-sass@4.13.1 postinstall C:\Users\Peter\AppData\Roaming\npm\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\Peter\AppData\Roaming\npm\node_modules\node-sass\vendor\win32-x64-64\binding.node
Testing binary
Binary is fine
+ node-sass@4.13.1
updated 1 package in 6.765s

你们中的一些人可以帮帮我吗?谢谢

标签: node.jsvisual-studio-codesass

解决方案


解决方法是:只需从您的机器中删除 nodejs 并再次安装它......


推荐阅读