【发布时间】: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
【问题讨论】: