TypeError [ERR_INVALID_ARG_TYPE]:The “path“ argument must be of type string. Received type undefined

一、npm run build 发生错误,代码如下,对号入座

> node build/build.js

- building for production...path.js:39
    throw new ERR_INVALID_ARG_TYPE('path', 'string', path);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at assertPath (path.js:39:11)
    at Object.resolve (path.js:166:7)
    at HtmlWebpackPlugin.apply (D:\NewVue\vuetest\node_modules\html-webpack-plugin\index.js:41:12)
    at Compiler.apply (D:\NewVue\vuetest\node_modules\tapable\lib\Tapable.js:375:16)
    at webpack (D:\NewVue\vuetest\node_modules\webpack\lib\webpack.js:33:19)
    at err (D:\NewVue\vuetest\build\build.js:19:3)
    at next (D:\NewVue\vuetest\node_modules\rimraf\rimraf.js:83:7)
    at CB (D:\NewVue\vuetest\node_modules\rimraf\rimraf.js:119:9)
    at FSReqWrap.oncomplete (fs.js:141:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vuetest@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vuetest@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\pen.chen\AppData\Roaming\npm-cache\_logs\2021-01-24T11_15_30_793Z-debug.log

 

二、网上查寻了很多,有不少关于版本的问题,我这里遇到的是“大白菜” 的问题。是在增加多网页设计时把内容填写错误导致。

 

三、上述 两个index 修改为对应的名称即可,如下:

 

四、这里的 one, two 是在如下这个位置里设置的。

五、我因为这个问题,查找了 3 个小时,写笔记,以免以后犯同样的问题。 大家共勉。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值