代码之家  ›  专栏  ›  技术社区  ›  Andrés Bolívar

顺风不与npm运行dev

  •  1
  • Andrés Bolívar  · 技术社区  · 4 年前

    我有一项任务要做,那就是用tailwindcss创建一些表单,但当我尝试启动:npm-run-build时,它不起作用。你能帮我吗?

    npm ERR! code ELIFECYCLE
    npm ERR! errno 9
    npm ERR! widgets@1.0.0 dev: `tailwind build css/tailwind.css -o build/css/tailwind.css`
    npm ERR! Exit status 9
    npm ERR! 
    npm ERR! Failed at the widgets@1.0.0 dev 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/andresbolivar/.npm/_logs/2022-01-21T16_59_01_550Z-debug.log
    

    这是我的包.json

    {
      "name": "widgets",
      "version": "1.0.0",
      "main": "index.js",
      "scripts": {
        "dev": "tailwind build style.css -o /css/tailwind.css"
      },
      "author": "",
      "license": "ISC",
      "devDependencies": {
        "autoprefixer": "^10.4.2",
        "postcss": "^8.4.5",
        "tailwindcss": "^3.0.15"
      },
      "dependencies": {},
      "description": ""
    }
    
    1 回复  |  直到 4 年前
        1
  •  0
  •   Terry    4 年前

    你需要 install Tailwind CLI 以便执行 tailwind 命令:

    # Using NPM?
    npm install -D tailwindcss
    
    # Using yarn?
    yarn add tailwindcss -D
    

    此外,它还有助于检查错误日志(如打印到终端的消息中所述),以找出错误的完整堆栈跟踪。