简体   繁体   English

npm 运行开发失败,laravel 8 引导和身份验证

[英]npm run dev failed with laravel 8 bootstrap and auth

I am using the laravel 8.x with laravel/ui package and bootstrap here is my steps I've run in cmd:我正在使用 laravel 8.x 和 laravel/ui package 和引导程序,这是我在 cmd 中运行的步骤:

composer require laravel/ui
php artisan ui bootstrap
php artisan ui bootstrap --auth
npm install && npm run dev

but it always returned this (at npm run dev' step): ' npm run dev issues但它总是返回这个(在 npm 运行开发步骤):' npm 运行开发问题

npm ERR! npm 错误! code ENOENT代码ENOENT

npm ERR! npm 错误! syscall spawn bash系统调用产生 bash

npm ERR: path C:\Work\testNPM npm ERR:路径 C:\Work\testNPM

npm ERR! npm 错误! errno -4058错误号 -4058

npm ERR! npm 错误! enoent spawn bash ENOENT enoent 产卵 bash ENOENT

npm ERR. npm 错误。 enoent This is related to npm not being able to find a file. enoent 这与 npm 找不到文件有关。

npm ERR! npm 错误! enoent恩恩

npm ERR: A complete log of this run can be found in: npm ERR:此运行的完整日志可在以下位置找到:

npm ERR: C.\Users\Huy\AppData\Local\npm-cache_logs\2022-07-12T07_10_08_779Z-debug-0.log npm ERR: C.\Users\Huy\AppData\Local\npm-cache_logs\2022-07-12T07_10_08_779Z-debug-0.log

The complete log完整的日志

I have re-install mpn (rm node modules and package-lock.jsol) and re-install latest nodejs 18.5 but it doesn't work.我重新安装了 mpn(rm 节点模块和 package-lock.jsol)并重新安装了最新的 nodejs 18.5,但它不起作用。 Need your helps here.在这里需要你的帮助。

I have read there's an issue with vite currently (PHP 9.x).我已经读过 vite 当前存在问题(PHP 9.x)。 What you can try is paste this in your package.json file, and try again:您可以尝试将其粘贴到您的package.json文件中,然后重试:

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "@popperjs/core": "^2.10.2",
        "axios": "^0.25",
        "bootstrap": "^5.1.3",
        "cross-env": "^7.0.3",
        "laravel-mix": "^6.0.49",
        "laravel-vite-plugin": "^0.2.1",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "resolve-url-loader": "^5.0.0",
        "sass": "^1.32.11",
        "sass-loader": "^11.0.1",
        "vite": "^2.9.11",
        "webpack-cli": "^4.10.0"
    },
    "name": "minicrm",
    "description": "<p align=\"center\"><a href=\"https://laravel.com\" target=\"_blank\"><img src=\"https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg\" width=\"400\"></a></p>",
    "version": "1.0.0",
    "main": "vite.config.js",
    "directories": {
        "test": "tests"
    },
    "dependencies": {
        "acorn": "^8.7.1",
        "acorn-import-assertions": "^1.8.0",
        "ajv": "^6.12.6",
        "ajv-keywords": "^3.5.2",
        "anymatch": "^3.1.2",
        "binary-extensions": "^2.2.0",
        "braces": "^3.0.2",
        "browserslist": "^4.21.1",
        "buffer-from": "^1.1.2",
        "caniuse-lite": "^1.0.30001363",
        "chokidar": "^3.5.3",
        "chrome-trace-event": "^1.0.3",
        "clone-deep": "^4.0.1",
        "colorette": "^2.0.19",
        "commander": "^2.20.3",
        "cross-spawn": "^7.0.3",
        "electron-to-chromium": "^1.4.182",
        "enhanced-resolve": "^5.10.0",
        "envinfo": "^7.8.1",
        "es-module-lexer": "^0.9.3",
        "esbuild": "^0.14.48",
        "esbuild-darwin-arm64": "^0.14.48",
        "escalade": "^3.1.1",
        "eslint-scope": "^5.1.1",
        "esrecurse": "^4.3.0",
        "estraverse": "^4.3.0",
        "events": "^3.3.0",
        "fast-deep-equal": "^3.1.3",
        "fast-json-stable-stringify": "^2.1.0",
        "fastest-levenshtein": "^1.0.12",
        "fill-range": "^7.0.1",
        "find-up": "^4.1.0",
        "follow-redirects": "^1.15.1",
        "fsevents": "^2.3.2",
        "function-bind": "^1.1.1",
        "glob-parent": "^5.1.2",
        "glob-to-regexp": "^0.4.1",
        "graceful-fs": "^4.2.10",
        "has": "^1.0.3",
        "has-flag": "^4.0.0",
        "immutable": "^4.1.0",
        "import-local": "^3.1.0",
        "interpret": "^2.2.0",
        "is-binary-path": "^2.1.0",
        "is-core-module": "^2.9.0",
        "is-extglob": "^2.1.1",
        "is-glob": "^4.0.3",
        "is-number": "^7.0.0",
        "is-plain-object": "^2.0.4",
        "isexe": "^2.0.0",
        "isobject": "^3.0.1",
        "jest-worker": "^27.5.1",
        "json-parse-even-better-errors": "^2.3.1",
        "json-schema-traverse": "^0.4.1",
        "kind-of": "^6.0.3",
        "klona": "^2.0.5",
        "loader-runner": "^4.3.0",
        "locate-path": "^5.0.0",
        "merge-stream": "^2.0.0",
        "mime-db": "^1.52.0",
        "mime-types": "^2.1.35",
        "nanoid": "^3.3.4",
        "neo-async": "^2.6.2",
        "node-releases": "^2.0.5",
        "normalize-path": "^3.0.0",
        "p-limit": "^2.3.0",
        "p-locate": "^4.1.0",
        "p-try": "^2.2.0",
        "path-exists": "^4.0.0",
        "path-key": "^3.1.1",
        "path-parse": "^1.0.7",
        "picocolors": "^1.0.0",
        "picomatch": "^2.3.1",
        "pkg-dir": "^4.2.0",
        "punycode": "^2.1.1",
        "randombytes": "^2.1.0",
        "readdirp": "^3.6.0",
        "rechoir": "^0.7.1",
        "resolve": "^1.22.1",
        "resolve-cwd": "^3.0.0",
        "resolve-from": "^5.0.0",
        "rollup": "^2.75.7",
        "safe-buffer": "^5.2.1",
        "schema-utils": "^3.1.1",
        "serialize-javascript": "^6.0.0",
        "shallow-clone": "^3.0.1",
        "shebang-command": "^2.0.0",
        "shebang-regex": "^3.0.0",
        "source-map": "^0.6.1",
        "source-map-js": "^1.0.2",
        "source-map-support": "^0.5.21",
        "supports-color": "^8.1.1",
        "supports-preserve-symlinks-flag": "^1.0.0",
        "tapable": "^2.2.1",
        "terser": "^5.14.1",
        "terser-webpack-plugin": "^5.3.3",
        "to-regex-range": "^5.0.1",
        "update-browserslist-db": "^1.0.4",
        "uri-js": "^4.4.1",
        "watchpack": "^2.4.0",
        "webpack": "^5.73.0",
        "webpack-merge": "^5.8.0",
        "webpack-sources": "^3.2.3",
        "which": "^2.0.2",
        "wildcard": "^2.0.0"
    },
    "keywords": [],
    "author": "",
    "license": "ISC"
}

I have find the answer: go to file \Users\username\ look for and edit the file.npmrc then find the line which contains 'bash'.我找到了答案:go 到文件 \Users\username\ 查找并编辑 file.npmrc 然后找到包含“bash”的行。 Delete that line and it works for me.删除该行,它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM