npm ERR! missing script: build

1、执行命令:npm run build 时,提示:npm ERR! Missing script: “build”。如图1

npm ERR! missing script: build_第1张图片

PS E:\xxx\yeunho-power-frontend\src> npm run build
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\86166\AppData\Local\npm-cache\_logs\2023-06-21T06_15_35_572Z-debug-0.log

2、查看 package.json 文件,可以确认 scripts 中并未包含 build 脚本。如图2

npm ERR! missing script: build_第2张图片

所以正确的命令应该为:

npm run build:prod

 

你可能感兴趣的:(npm,前端,node.js)