【问题标题】:Using NPM for SCSS but the script will not watch for changes. It gives me a error对 SCSS 使用 NPM,但脚本不会监视更改。它给了我一个错误
【发布时间】:2019-09-14 10:10:38
【问题描述】:

我已经安装了 Node v12.10.0、NPM v6.10.3。我也尝试安装节点 LTS 版本。

我建立了我的项目目录,并在该目录中运行了“npm init”,然后运行了“npm install --save-dev node-sass”。到目前为止,一切似乎都很好。

我的 package.json 文件看起来像这样

   {
  "name": "dashboard",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "scss": "node-sass --watch scss -o css"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "node-sass": "^4.12.0"
  }
}

在我运行“npm run scss”之后,我会收到这个。

> dashboard@1.0.0 scss /Users/adakaitalker/Documents/school/dev/learning/2-september/4-week/9:13:19/dashboard
> node-sass --watch scss -o css

sh: node-sass: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! dashboard@1.0.0 scss: `node-sass --watch scss -o css`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the dashboard@1.0.0 scss script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/adakaitalker/.npm/_logs/2019-09-13T22_43_56_711Z-debug.log

【问题讨论】:

    标签: node.js npm sass


    【解决方案1】:

    想通了。我安装了 homebrew 并将其链接到节点,然后我使用 homebrew 卸载它并重新安装它,它现在可以工作了。

    【讨论】:

      猜你喜欢
      • 2015-11-14
      • 1970-01-01
      • 2020-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-28
      • 1970-01-01
      • 2020-09-10
      相关资源
      最近更新 更多