安装微风时 npm install && npm run dev 出错

时间:2021-01-12 11:03:29

标签: php node.js laravel npm breeze

我是 Laravel 的新手,想在我的 Laravel 应用程序中使用微风身份验证。 我创建了我的项目并迁移了我的数据库表,然后根据我运行的微风教程

composer require laravel/breeze --dev

php artisan breeze:install

成功。但运行此代码后出现这些错误

npm install && npm run dev

现在是结果。有人可以帮我吗?

F:\kishcharkh>npm install && npm run dev

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7(node_modules\chokidar\node_modules\fsevents):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Invalid protocol: 127.0.0.1:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2
(node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Invalid protocol: 127.0.0.1:
> @ dev F:\kishcharkh

> npm run development

> @ development F:\kishcharkh
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js

        Additional dependencies must be installed. This will only take a moment.

        Running: npm install vue-template-compiler --save-dev --production=false

npm ERR! Invalid protocol: 127.0.0.1:

npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\masih\AppData\Roaming\npm-cache\_logs\2021-01-12T09_52_45_253Z-debug.log
F:\kishcharkh\node_modules\webpack-cli\bin\cli.js:93
                                throw err;
                                ^

Error: Command failed: npm install vue-template-compiler --save-dev --production=false
npm ERR! Invalid protocol: 127.0.0.1:

npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\masih\AppData\Roaming\npm-cache\_logs\2021-01-12T09_52_45_253Z-debug.log

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js`

npm ERR! Exit status 1

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!     C:\Users\masih\AppData\Roaming\npm-cache\_logs\2021-01-12T09_52_45_353Z-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.

这里是 package.json 文件:

    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.2.1",
        "alpinejs": "^2.7.3",
        "autoprefixer": "^10.1.0",
        "axios": "^0.19",
        "cross-env": "^7.0",
        "laravel-mix": "^5.0.1",
        "lodash": "^4.17.19",
        "postcss": "^8.2.1",
        "postcss-import": "^12.0.1",
        "resolve-url-loader": "^3.1.0",
        "tailwindcss": "^2.0.2"
    }
}

1 个答案:

答案 0 :(得分:0)

一天前我确实与它战斗过。我发现如果错误仍然存​​在:

<块引用>

rm -rf node_modules rm package.lock.json npm 缓存清除 --force 安装 npm 运行开发

然后错误是我的节点已经过时了。更新到最新版本