gpt4 book ai didi

node.js - npm 运行前缀 :css ERR

转载 作者:太空宇宙 更新时间:2023-11-03 22:58:13 25 4
gpt4 key购买 nike

我的系统配置

OS : Microsoft Windows 10,
code editor : Visual Studio Code
node version : v10.13.0,
npm version : 6.4.1

以下命令npm run startnpm runco​​mpile:sassnpm run concat::css 运行良好。
但是 npm run prefix:css 抛出错误。

我在两种情况下工作,一种可以连接互联网,另一种则不能。
昨天我在家工作,可以连接互联网。

首先,我做了npm install postcss --save-dev
然后我做了npm run prefix:css
控制台抛出错误。

我的问题是什么?
我该如何解决这个问题。

奇怪的是,“postcss.cmd”命令不是在“node_modules.bin”文件夹中创建的。
其他普通命令在“node_modules.bin”文件夹中执行。

  1. 我的 package.json 是
{    "name": "natours",    "version": "1.0.0",    "description": "landing page for natours",    "main": "index.js",    "scripts": {        "watch:sass": "node-sass sass/main.scss css/natours.sass -w",        "devserver": "live-server",        "start": "npm-run-all --parallel devserver watch:sass",        "compile:sass": "node-sass sass/main.scss css/natours.comp.css",        "concat:css": "concat -o css/natours.concat.css css/icon-font.css css/natours.comp.css",        "prefix:css": "postcss --use autoprefixer -b 'last 10 versions' css/natours.concat.css  -o css/natours.prefix.css",        "compass:css": "node-sass css/natours.prefix.css css/natours.css --output-style compressd",        "build:css": "npm-run-all compile:sass concat:css prefix:css compass:css"    },    "author": "Jsmile",    "license": "ISC",    "dependencies": {        "save-dev": "^2.0.0"    },    "devDependencies": {        "autoprefixer": "^9.4.4",        "concat": "^1.0.3",        "node-sass": "^4.11.0",        "npm-run-all": "^4.1.5",        "postcss": "^7.0.8"    }}
  1. Here I reproduced the error by following commands
F:\개인\workspace\CSS\css_sass\1-Natours>npm install postcss --save-dev  
npm WARN natours@1.0.0 No repository field.

+ postcss@7.0.8
updated 1 package and audited 639 packages in 2.778s
found 0 vulnerabilities

F:\개인\workspace\CSS\css_sass\1-Natours>npm run prefix:css

> natours@1.0.0 prefix:css F:\개인\workspace\CSS\css_sass\1-Natours
> postcss --use autoprefixer -b 'last 10 versions' css/natours.concat.css -o css/natours.prefix.css

'postcss'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치 파일이 아닙니다.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! natours@1.0.0 prefix:css: `postcss --use autoprefixer -b 'last 10 versions' css/natours.concat.css -o css/natours.prefix.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the natours@1.0.0 prefix:css 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\No.1\AppData\Roaming\npm-cache\_logs\2019-01-10T22_37_17_074Z-debug.log

最佳答案

"prefix:css": "postcss --use autoprefixer -b \"last 10 versions\" css/natours.concat.css  -o css/natours.prefix.css"

关于node.js - npm 运行前缀 :css ERR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54148975/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com