Laravel 7:无法在全新安装时运行 Dev

时间:2021-02-23 15:52:13

标签: php node.js laravel npm

我目前正在执行这些终端命令:

  1. composer create-project --prefer-dist laravel/laravel:^7.0
  2. 作曲家需要 laravel/ui:^2.4
  3. php artisan ui bootstrap --auth
  4. npm install && npm run dev

这将返回以下错误

sh: mix: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! @ development: `mix`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the @ development 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!     /home/jonahmar/.npm/_logs/2021-02-23T15_46_54_252Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ 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!     /home/jonahmar/.npm/_logs/2021-02-23T15_46_54_277Z-debug.log

我无法修复或识别问题,我已执行以下操作以尝试修复问题:

  1. npm 重建 node-sass
  2. npm install --global cross-env
  3. npm 缓存清理 --force
  4. npm install laravel-mix --save-dev

无济于事,我在运行此命令之前也收到警告:

npm WARN lifecycle The node binary used for scripts is /home/jonahmar/nodevenv/onyx.website.io/12/bin/node but npm is using /opt/alt/alt-nodejs12/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

当前的网络服务器是 Litespeed Enterprise,具有最新版本的 Composer 和节点。

{
    "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": {
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14"
    }
}

0 个答案:

没有答案