【发布时间】:2020-01-31 16:26:44
【问题描述】:
我正在使用 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
你们中的一些人可以帮帮我吗?谢谢
【问题讨论】:
-
I tried to execute the following phowershell command ... but both are not working- 错误具体说明了什么? -
when I built in visual studio code是什么意思?您如何使用node-sass?你的安装 - 正如你的问题所问 - 似乎很好(通过npm i -g node-sass) -
我使用nodesass作为编译器voor scss
标签: node.js visual-studio-code sass