1、问题:
Your global`在这里插入代码片` Angular CLI version (12.1.1) is greater than your local version (11.2.14). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
翻译过来是:您的全局CLI版本(12.1.1)高于本地版本(11.2.14)。使用本地CLI版本。
要禁用此警告,请使用“ng config-g cli.warnings.versionMismatch false”。
解决办法:升级版本
具体操作:(好像等一会就自己好了,但是最好升级一下版本)
在cmd升级:npm install --save-dev @angular/cli@latest
2、问题:The serve command requires to be run in an Angular project, but a project definition could not be found.
解决办法:
翻译过来:
serve命令要求在角度项目中运行,但找不到项目定义
你在终端或者cmd里cd到angular项目的根目录(package.json的所在文件夹)再ng serve运行就可以了
。
2,问题:
npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN karma-jasmine-html-reporter@1.7.0 requires a peer of jasmine-core@>=3.8 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-echarts@7.0.1 requires a peer of @juggle/resize-observer@>=3.3.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
翻译过来是:
npm警告ajv-keywords@3.5.2需要ajv@^6.9.1对等机,但未安装任何对等机。必须自己安装对等依赖项。
npm警告因果报应茉莉花html-reporter@1.7.0需要jasmine core@>=3.8的对等机,但未安装。必须自己安装对等依赖项。
npm警告ngx-echarts@7.0.1需要@juggle/resize observator@>=3.3.1的对等方,但未安装任何对等方。必须自己安装对等依赖项。
npm WARN optional跳过可选依赖项:fsevents@2.3.2(节点\u模块\fsevents):
npm WARN notsup跳过可选依赖项:不支持的平台fsevents@2.3.2:通缉{“os”:“darwin”,“arch”:“any”}(当前:{“os”:“win32”,“arch”:“x64”})
npm WARN optional跳过可选依赖项:fsevents@1.2.13(node\u modules\webpack dev server\node\u modules\fsevents):
npm WARN notsup跳过可选依赖项:不支持的平台fsevents@1.2.13:通缉{“os”:“darwin”,“arch”:“any”}(当前:{“os”:“win32”,“arch”:“x64”})
解决办法:
npm install ajv@^6.9.1
3,问题:
npm WARN karma-jasmine-html-reporter@1.7.0 requires a peer of jasmine-core@>=3.8 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ ajv@6.9.1
added 3 packages from 1 contributor and updated 1 package in 8.908s
问题分析:我看到有帖子说,这个警告说你的包karma-jasmine-html-reporter与jasmine版本>=3有同伴依赖。 基本上,如果您安装最新版本的jasmine ,则会删除警告。 目前最新版本的jasmine是3.1.0,如果你安装该版本,你的问题就会消失。
您可以通过运行npm install --save-dev jasmine来修复此警告。
但是我这样做了以后问题还是没有解决,
这个问题是我在安装echarts的依赖时出现的问题,
只要我
npm install echarts --save
就会报上面的错误,但是当我把npm改成cnpm时,这个问题居然就解决了,具体为啥我也不知道,成功后的界面如下所示:
√ Installed 1 packages
√ Linked 3 latest versions
√ Run 0 scripts
√ All packages installed (3 packages installed from npm registry, used 19s(network 19s), speed 475.57KB/s, json 3(14.17KB), tarball 8.71MB)