当前位置:   article > 正文

TypeError [ERR_INVALID_ARG_TYPE]:The “path“ argument must be of type string. Received type undefined_typeerror [err_invalid_arg_type]: the "path" argum

typeerror [err_invalid_arg_type]: the "path" argument must be of type string

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

  1. > node build/build.js
  2. - building for production...path.js:39
  3. throw new ERR_INVALID_ARG_TYPE('path', 'string', path);
  4. ^
  5. TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
  6. at assertPath (path.js:39:11)
  7. at Object.resolve (path.js:166:7)
  8. at HtmlWebpackPlugin.apply (D:\NewVue\vuetest\node_modules\html-webpack-plugin\index.js:41:12)
  9. at Compiler.apply (D:\NewVue\vuetest\node_modules\tapable\lib\Tapable.js:375:16)
  10. at webpack (D:\NewVue\vuetest\node_modules\webpack\lib\webpack.js:33:19)
  11. at err (D:\NewVue\vuetest\build\build.js:19:3)
  12. at next (D:\NewVue\vuetest\node_modules\rimraf\rimraf.js:83:7)
  13. at CB (D:\NewVue\vuetest\node_modules\rimraf\rimraf.js:119:9)
  14. at FSReqWrap.oncomplete (fs.js:141:20)
  15. npm ERR! code ELIFECYCLE
  16. npm ERR! errno 1
  17. npm ERR! vuetest@1.0.0 build: `node build/build.js`
  18. npm ERR! Exit status 1
  19. npm ERR!
  20. npm ERR! Failed at the vuetest@1.0.0 build script.
  21. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  22. npm ERR! A complete log of this run can be found in:
  23. npm ERR! C:\Users\pen.chen\AppData\Roaming\npm-cache\_logs\2021-01-24T11_15_30_793Z-debug.log

 

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

 

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

 

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

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

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/198187
推荐阅读
相关标签
  

闽ICP备14008679号