如何 运行 `npm 运行 build`
How to run `npm run build`
我在 VueJS 应用程序中工作。我想在 cPanel 中部署应用程序。我正在尝试 运行 npm run build
。我遇到错误。
如果我 运行 npm run
命令我得到低于结果。
我怎样才能运行npm run 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"
}
}
您的应用没有build
命令。
看起来你有一个 Laravel 应用;默认情况下,它有 两个 构建命令,npm run dev
(加上 npm run watch
,类似于 npm run dev
除了它保留 运行 和 re-building 当您的代码更改时,npm run hot
与 hot-reloading) 和 npm run prod
类似,但与 npm run prod
类似。两者都构建您的 front-end 代码,但 prod
变体添加了诸如代码缩小之类的东西。
我会 re-read https://laravel.com/docs/9.x/mix#running-mix 的 Mix 文档以复习一下。里面有很多重要的东西需要注意。
我在 VueJS 应用程序中工作。我想在 cPanel 中部署应用程序。我正在尝试 运行 npm run build
。我遇到错误。
如果我 运行 npm run
命令我得到低于结果。
我怎样才能运行npm run 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"
}
}
您的应用没有build
命令。
看起来你有一个 Laravel 应用;默认情况下,它有 两个 构建命令,npm run dev
(加上 npm run watch
,类似于 npm run dev
除了它保留 运行 和 re-building 当您的代码更改时,npm run hot
与 hot-reloading) 和 npm run prod
类似,但与 npm run prod
类似。两者都构建您的 front-end 代码,但 prod
变体添加了诸如代码缩小之类的东西。
我会 re-read https://laravel.com/docs/9.x/mix#running-mix 的 Mix 文档以复习一下。里面有很多重要的东西需要注意。