赞
踩
vue-cli
创建 vue3.x
版本项目报错error Couldn't find package "postcss-normalize-string@^4.0.2" required by "cssnano-preset-default@^4.0.0" on the "npm" registry.
Error: Couldn't find package "@vue/cli-overlay@^4.5.9" required by "@vue/cli-service@~4.5.0" on the "npm" registry.
at MessageError.ExtendableBuiltin (/usr/local/lib/node_modules/yarn/lib/cli.js:243:66)
at new MessageError (/usr/local/lib/node_modules/yarn/lib/cli.js:272:123)
at PackageRequest.<anonymous> (/usr/local/lib/node_modules/yarn/lib/cli.js:38988:17)
at Generator.throw (<anonymous>)
at step (/usr/local/lib/node_modules/yarn/lib/cli.js:92:30)
at /usr/local/lib/node_modules/yarn/lib/cli.js:105:13
at process._tickCallback (internal/process/next_tick.js:68:7)
ERROR command failed: yarn
原因:vue-cli
创建的 vue3.x
版本项目使用 yarn
进行 node_modules
包的下载,这种报错原因是本地的 yarn
版本太低
可以从报错信息上面看到 yarn
的版本是 1.9.4
,升级 yarn
之后就可以了
升级yarn
yarn
的方式升级完成之后可以通过 yarn -v
查看 yarn
的版本
yarn -v
1.22.10
升级完成 重新 vue create myApp
即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。