【问题标题】:npm with compilation process sass cammand linenpm 与编译过程 sass 命令行
【发布时间】:2021-11-10 08:42:04
【问题描述】:

我在使用命令行编译过程 sass 时遇到问题,我使用 npm.js,我正在尝试学习 scss。

任何帮助将不胜感激,这是文件 package.json

代码下面的问题
{
  "name": "yes",
  "version": "1.0.0",
  "description": "guitar website",
  "main": " ",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "sass": "node-sass sass/main.scss css/style.css -w",
    "server": "live-server --browser=chrome",
    "start": "npm-run-all --parallel server sass"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "node-sass": "^6.0.1",
    "npm-run-all": "^4.1.5"
  }
}

终端显示此错误:

    User@DESKTOP-JKP464G MINGW64 ~/Desktop/learn with elzero/template 3 html scss
$ npm run start

> yes@1.0.0 start C:\Users\User\Desktop\learn with elzero\template 3 html scss
> npm-run-all --parallel server sass


> yes@1.0.0 server C:\Users\User\Desktop\learn with elzero\template 3 html scss
> live-server --browser=chrome


> yes@1.0.0 sass C:\Users\User\Desktop\learn with elzero\template 3 html scss
> node-sass sass/main.scss css/style.css -w

'live-server' is not recognized as an internal command
or external, an executable program or a batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yes@1.0.0 server: `live-server --browser=chrome`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yes@1.0.0 server 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!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2021-08-23T16_02_37_907Z-debug.log 
ERROR: "server" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yes@1.0.0 start: `npm-run-all --parallel server sass`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yes@1.0.0 start 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!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2021-08-23T16_02_38_125Z-debug.log 

【问题讨论】:

标签: css node.js sass command-line compilation


【解决方案1】:

检查你是否有 node_modules 文件夹,否则你应该执行 npm-install node-sass --save。在运行脚本之前

【讨论】:

    猜你喜欢
    • 2016-05-11
    • 1970-01-01
    • 2018-11-28
    • 2021-08-02
    • 2017-01-12
    • 2021-10-05
    • 1970-01-01
    • 1970-01-01
    • 2013-07-30
    相关资源
    最近更新 更多