运行serve
命令时发生类型错误。
$ vue-cli-service serve
INFO Starting development server...
ERROR TypeError: Cannot read properties of undefined (reading 'split')
TypeError: Cannot read properties of undefined (reading 'split')
at toIdentifier (/Users/minskiter/Desktop/Code/QWikiFE/node_modules/serve-index/node_modules/http-errors/index.js:257:14)
at forEachCode (/Users/minskiter/Desktop/Code/QWikiFE/node_modules/serve-index/node_modules/http-errors/index.js:228:16)
at Array.forEach (<anonymous>)
at populateConstructorExports (/Users/minskiter/Desktop/Code/QWikiFE/node_modules/serve-index/node_modules/http-errors/index.js:226:9)
at Object.<anonymous> (/Users/minskiter/Desktop/Code/QWikiFE/node_modules/serve-index/node_modules/http-errors/index.js:29:1)
at Module._compile (node:internal/modules/cjs/loader:1191:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
at Module.load (node:internal/modules/cjs/loader:1069:32)
at Function.Module._load (node:internal/modules/cjs/loader:904:12)
at Module.require (node:internal/modules/cjs/loader:1093:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
如何解决此问题?
1条答案
按热度按时间hivapdat1#
这是一个特例。删除
yarn.lock
并重新执行yarn
命令后问题解决。