0

我一直在尝试npm run serve在使用 Vue CLI 生成的新 vue 项目上运行。我只是创建项目,vue create app然后将目录更改为项目本身cd app并运行npm run serve我之前在其他项目中做过的事情,但从昨天开始我一直收到此错误:我收到此错误:

INFO  Starting development server...
ERROR  Error: No valid exports main found for 'D:\Documents\app\node_modules\colorette'
Error: No valid exports main found for 'D:\Documents\app\node_modules\colorette'
at resolveExportsTarget (internal/modules/cjs/loader.js:618:9)
at applyExports (internal/modules/cjs/loader.js:499:14)
at resolveExports (internal/modules/cjs/loader.js:548:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:650:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:948:27)
at Function.Module._load (internal/modules/cjs/loader.js:854:27)
at Module.require (internal/modules/cjs/loader.js:1023:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> 
(D:\Documents\app\node_modules\autoprefixer\lib\autoprefixer.js:5:17)
at Module._compile (internal/modules/cjs/loader.js:1128:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@0.1.0 serve 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\acamp\AppData\Roaming\npm-cache\_logs\2020-07-07T01_02_53_207Z-debug.log

我已经尝试删除我的node_modules然后运行npm i但它没有解决它。还尝试将 vue CLI 更新到最新版本,npm i @vue/cli但也无济于事。

我创建的所有新项目都会发生这种情况请帮助!

4

1 回答 1

-1

请将您的 node-js 更新为 v14.xx

于 2020-07-17T08:38:36.010 回答