npm run build 报错

npm run build 报错

http://img1.sycdn.imooc.com//climg/5f79a75c09f043a811760335.jpg


打开日志显示内容:

0 info it worked if it ends with ok

1 verbose cli [

1 verbose cli   'D:\\chenxumulu\\node.js\\node.exe',

1 verbose cli   'C:\\Users\\57869\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',

1 verbose cli   'run',

1 verbose cli   'build'

1 verbose cli ]

2 info using npm@6.14.8

3 info using node@v12.18.3

4 verbose stack Error: missing script: build

4 verbose stack

4 verbose stack Did you mean this?

4 verbose stack     build:

4 verbose stack     at run (C:\Users\57869\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:155:19)

4 verbose stack     at C:\Users\57869\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:63:5

4 verbose stack     at C:\Users\57869\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:116:5

4 verbose stack     at C:\Users\57869\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:436:5

4 verbose stack     at checkBinReferences_ (C:\Users\57869\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:391:45)

4 verbose stack     at final (C:\Users\57869\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:434:3)

4 verbose stack     at then (C:\Users\57869\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:161:5)

4 verbose stack     at ReadFileContext.<anonymous> (C:\Users\57869\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:350:20)

4 verbose stack     at ReadFileContext.callback (C:\Users\57869\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:123:16)

4 verbose stack     at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13)

5 verbose cwd C:\Users\57869\Desktop\lxdm\demo1

6 verbose Windows_NT 10.0.18363

7 verbose argv "D:\\chenxumulu\\node.js\\node.exe" "C:\\Users\\57869\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"

8 verbose node v12.18.3

9 verbose npm  v6.14.8

10 error missing script: build

10 error

10 error Did you mean this?

10 error     build:

11 verbose exit [ 1, true ]


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

同学你好,看另外一个问题中npm run build是可以编译的,应该是解决了吧。

报错提示信息是script中缺少了build,是不是忘记配置了呢?如果忘记了可以配置下

http://img1.sycdn.imooc.com//climg/5f7ebb2809547c8a05740087.jpg

祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师