如何运行`npm run build'

发布于 2025-01-31 13:51:05 字数 2019 浏览 0 评论 0 原文

我正在VUEJS应用程序中工作。我想将应用程序部署在CPanel中。我正在尝试运行 npm run build 。我要低于错误。

https://ibb.co/0qn30tx

如果我运行 npm npm run 低于结果。

https://ibb.co/xp9bddp

如何运行 npm run build build build

这是我的 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": {
        "autoprefixer": "^10.2.5",
        "axios": "^0.21",
        "jquery": "^3.2",
        "laravel-echo": "^1.10.0",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "popper.js": "^1.12",
        "postcss": "^8.2.8",
        "pusher-js": "^7.0.3",
        "resolve-url-loader": "^2.3.1",
        "sass": "^1.20.1",
        "sass-loader": "^8.0.0",
        "tailwindcss": "^2.0.4",
        "vue": "^2.6.12",
        "vue-loader": "^15.9.5",
        "vue-template-compiler": "^2.6.10"
    },
    "dependencies": {
        "@webzlodimir/vue-bottom-sheet": "^1.2.0",
        "moment-timezone": "^0.5.33",
        "swiper": "^6.8.0",
        "vue-awesome-swiper": "^4.1.1",
        "vue-axios": "^3.2.4",
        "vue-meta": "^2.4.0",
        "vue-moment": "^4.1.0",
        "vue-multiselect": "^2.1.6",
        "vue-notification": "^1.3.20",
        "vue-router": "^3.5.1",
        "vue-social-auth": "^1.4.9",
        "vue-social-sharing": "^3.0.8",
        "vue-spinner": "^1.0.4",
        "vue-star-rating": "^1.7.0",
        "vue-tabs-with-active-line": "^1.2.6",
        "vue2-editor": "^2.10.2",
        "vue2-timeago": "^1.2.12",
        "vuex": "^3.6.2"
    }
}

I am working in a VueJS application. I would like to deploy the application in a cPanel. I am trying to run npm run build. I am getting below error.

https://ibb.co/0Qn30TX

If I run npm run command I am getting below result.

https://ibb.co/Xp9bdDp

How can I run npm run build ?

Here is my 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": {
        "autoprefixer": "^10.2.5",
        "axios": "^0.21",
        "jquery": "^3.2",
        "laravel-echo": "^1.10.0",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "popper.js": "^1.12",
        "postcss": "^8.2.8",
        "pusher-js": "^7.0.3",
        "resolve-url-loader": "^2.3.1",
        "sass": "^1.20.1",
        "sass-loader": "^8.0.0",
        "tailwindcss": "^2.0.4",
        "vue": "^2.6.12",
        "vue-loader": "^15.9.5",
        "vue-template-compiler": "^2.6.10"
    },
    "dependencies": {
        "@webzlodimir/vue-bottom-sheet": "^1.2.0",
        "moment-timezone": "^0.5.33",
        "swiper": "^6.8.0",
        "vue-awesome-swiper": "^4.1.1",
        "vue-axios": "^3.2.4",
        "vue-meta": "^2.4.0",
        "vue-moment": "^4.1.0",
        "vue-multiselect": "^2.1.6",
        "vue-notification": "^1.3.20",
        "vue-router": "^3.5.1",
        "vue-social-auth": "^1.4.9",
        "vue-social-sharing": "^3.0.8",
        "vue-spinner": "^1.0.4",
        "vue-star-rating": "^1.7.0",
        "vue-tabs-with-active-line": "^1.2.6",
        "vue2-editor": "^2.10.2",
        "vue2-timeago": "^1.2.12",
        "vuex": "^3.6.2"
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

路弥 2025-02-07 13:51:05

您的应用程序没有 a 构建命令。

看起来您有一个Laravel应用程序;默认情况下,它具有两个构建命令, npm Run dev (加上 npm Run Watch ,就像 npm Run Run Dev 除非在代码更改时继续运行和重建,而 npm运行热 ,但使用热重载)和 npm run run prod 。两者都会构建您的前端代码,但是 prod 变体添加了诸如代码的简化之类的内容。

我会在用于复习。那里有各种各样的重要内容。

Your app doesn't have a build command.

Looks like you've got a Laravel app; by default, it has two build commands, npm run dev (plus npm run watch, which is like npm run dev except it keeps running and re-building when your code changes, and npm run hot, which does similar but with hot-reloading), and npm run prod. Both build your front-end code, but the prod variant adds things like minification of the code.

I'd re-read the Mix docs at https://laravel.com/docs/9.x/mix#running-mix for a refresher. There's a variety of important stuff in there to be aware of.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文