node.js - 安装节点 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
你们中的一些人可以帮帮我吗?谢谢
解决方案
解决方法是:只需从您的机器中删除 nodejs 并再次安装它......
推荐阅读
- objective-c - 如何在objective-c中正确地printf float (*)()?
- php - 在 If-else Scoop 中返回一个数组
- redis - 处理分布式长期任务的 pubsub 订阅者
- html - 每个节点的 xsl 创建折叠/展开面板
- javascript - Javascript中二维数组的所有可能组合
- python - Django:如何根据查找表的值连接表
- tensorflow - TensorFlow Estimator 跟踪时间线?
- signalr - 错误 @types/signalr/index.d.ts 不是 ta 模块
- html - 如何使css div子宽度适合div父级
- python - 在未来的 matplotlib 中不推荐使用 cross_from_above ... 替换功能?