今天用npm打包项目的时候,用 "npm run build" 打包发生以下错误:

npm ERR!  missing script: build

npm ERR!  A complete log of this run can be found in:
npm ERR!   C:\Users\AppData\Roaming\npm-cache\_logs\2022-09-16T08_06_52_296Z-debug.log

第一个 npm ERR! 是因为缺少脚本:构建

第二个 npm ERR! 是因为此运行的日志可以再以下位置找到:

npm ERR!   C:\Users\AppData\Roaming\npm-cache\_logs\2022-09-16T08_06_52_296Z-debug.log

解决办法:

查看 package.json 中 scripts下打包命令 vue-cli-service build 是什么?我的如下:

"scripts": {

"dev": "vue-cli-service serve",

"build:prod": "vue-cli-service build",

"build:stage": "vue-cli-service build --mode staging",

"preview": "node build/index.js --preview",

"lint": "eslint --ext .js,.vue src",

"test:unit": "jest --clearCache && vue-cli-service test:unit",

"test:ci": "npm run lint && npm run test:unit",

"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"

},

我的打包命令是 build:prod ,因此使用 npm run build:prod,则打包成功。

 如果没有打包命令,则需要自己手动添加打包命令。

npm打包项目报错:npm ERR! A complete log of this run can be found in:npm ERR! C:\Users\AppData\Roa...相关推荐

  1. npm ERR A complete log of this run can be found in npm ERR CUsersAppDataRoamingnpm-ca

    npm ERR! A complete log of this run can be found in: npm ERR! C:Users**AppDataRoaming pm-cache_logs? ...

  2. npm ERR! cb.apply is not a function npm ERR! A complete log of this run can be found in: npm ERR!

    npm ERR! cb.apply is not a function npm ERR! A complete log of this run can be found in: npm ERR! C: ...

  3. 【解决】npm ERR A complete log of this run can be found in npm ERR

    有一些同学可能想配置react的运行环境,苦于不同的电脑遇到千奇百怪的问题和ERROR.下面是我遇到问题对应的解决方案,希望对你们有帮助. 本来我们的基本步骤是: 下载好nvm文件 在里面下载node ...

  4. 关于报错信息为A complete log of this run can be found in:

    几天没打开项目,今天准备练习,运行项目的时候就出现了以上报错,按照网上教的解决方法把node-modules删了,重新执行npm install,还是不能生成node-modules文件.最后发现我打 ...

  5. npm 报错 : npm ERR! Maximum call stack size exceeded npm ERR! A complete log of this run can be found

    之前,在npm下载包的时候出现一个错误: npm ERR! Maximum call stack size exceeded npm ERR! A complete log of this run c ...

  6. Macos下执行npm打包vue报错

    问题描述 victorwk@localhost vue-ui % npm run build> saber-admin@2.4.1 build /Volumes/victor/java_abou ...

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

    第一次接触vue项目的时候,拿了别人的代码,安装了依赖包以后一运行,发现有报错 npm ERR! A complete log of this run can be found in: npm ERR ...

  8. 运行VUE项目时,出现npm ERR! A complete log of this run can be found in:...报错

    运行VUE项目时,出现npm ERR! A complete log of this run can be found in:报错时,分享以下一种解决方案. 本机的 node版本如下 解决方法 1. ...

  9. npm 报错 ERR Cannot read properties of null reading ‘package npm ERR A complete log of this run can

    通过npm install 安装依赖报如下错误. 解决办法:尝试通过cnpm install 或yarn install 即可解决.

  10. npm 启动项目报错 Cannot find module ‘\@babel\compat-data\data\corejs3-shipped-proposals‘

    执行 npm install -D babel-loader @babel/core @babel/preset-env webpack

最新文章

  1. Mysql高并发优化
  2. 程序员发现 Bug 的时候是怎样一种心境?
  3. LeetCode 669. Trim a Binary Search Tree修剪二叉搜索树 (C++)
  4. [Android]使用platform密钥来给apk文件签名的命令
  5. Memcached入门指南
  6. oracle 11g12c(pdbcdb)系统巡检
  7. Hadoop源码分析21:namenode概要
  8. 苹果承认iPhone 12“绿屏”等问题:目前正进行调查
  9. erp系统是什么软件有哪些
  10. 数据采集及采集工具八爪鱼的使用
  11. web前端开发面试题(四)
  12. 超全面整理fastAPI(从入门到运用),进来看十秒钟再走不迟
  13. linux系统中怎么配置路由,Linux系统中路由配置介绍
  14. vue-giant-tree 插件 报错. init if undefined
  15. Vision-and-Language Navigation: Interpreting visually-grounded navigation instructions in real env
  16. FPGA之道(16)FPGA开发流程之项目方案与FPGA设计方案
  17. oracle重建inventory,Oracle中Inventory目录作用以及如何重建此目录-Oracle
  18. Ubuntu14.04搭建LXR本地服务器阅读Linux内核代码
  19. TensorFlow 从入门到精通(13)—— NLP初探:电影评论感情分析
  20. element-ui message 显示重叠问题

热门文章

  1. Fluent 安装过程
  2. 开源淘宝客APP源码淘客商城源码uniapp开发模版
  3. PowerDesigner16.5操作,从mysql反向生成ER图
  4. tomcat设置编码问题
  5. 内嵌网页 UniWebView 3 的使用
  6. 判断素数的方法(java)
  7. CIF、DCIF、D1分辨率
  8. 使用java udp开发图片拆包组包例子
  9. eclipse汉化教程,保姆级教学,解决下载缓慢、安装不上等问题,随时中英互换,官网汉化包
  10. 计算机操作系统(第四版)课后习题答案(完整版)