NodeJS Vue2.7 vue-cli-service无法正常启动

oipij1gg  于 2023-04-29  发布在  Node.js
关注(0)|答案(1)|浏览(148)

运行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.

如何解决此问题?

hivapdat

hivapdat1#

这是一个特例。删除yarn.lock并重新执行yarn命令后问题解决。

相关问题