大家好,当我尝试从终端(linux)运行我的应用程序时,当我运行此命令时,我有下一个错误:
纳服
我在我的终端中得到这个错误:
AppBlog/blog# ng serve
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
Require stack:
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/index.js
- /usr/local/lib/node_modules/@angular/cli/models/architect-command.js
- /usr/local/lib/node_modules/@angular/cli/commands/serve-impl.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/index.js
- /usr/local/lib/node_modules/@angular/cli/utilities/json-schema.js
- /usr/local/lib/node_modules/@angular/cli/models/command-runner.js
- /usr/local/lib/node_modules/@angular/cli/lib/cli/index.js
- /usr/local/lib/node_modules/@angular/cli/lib/init.js
- /usr/local/lib/node_modules/@angular/cli/bin/ng
See "/tmp/ng-ev5aDi/angular-errors.log" for further details.
然后我检查了这个部分:
发生未处理的异常:找不到模块“@angular-开发工具包/构建-角度/包.json”
这部分说找不到名为“' @ angular-dev kit/build-angular/package . JSON '”的模块
然后我在我的项目中签出了这个文件,但我有这个,看:
html prettyprint-override"> "devDependencies": {
"@angular-devkit/build-angular": "~0.900.3",
"@angular/cli": "~9.0.3",
"@angular/compiler-cli": "~9.0.2",
"@angular/language-service": "~9.0.2",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~5.18.0",
"typescript": "~3.7.5"
}
然后我去谷歌和搜索,我发现这个像堆栈溢出,我尝试了他们的解决方案,但它不起作用,我再次运行命令ng服务。
我做错了什么?
之前没有,之前我添加了3组件:登录,注册和家在我的文件夹:src/app与此命令:ng生成组件登录和我导入我的组件在我的文件:app.component.ts这样:
/* THIS IS JUST A EXAMPLE VERY SIMILAR TO MY CODE REAL, I just import one component*/
import { Component } from '@angular/core';
import { loginComponent } from './login.component';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
declarations: [loginComponent], //import my login
})
export class AppComponent {
title = 'blog';
}
也许是这一部分,但我没有找到解决办法,任何专家可以告诉我,我做错了什么?
更新
我继续在google中搜索,我发现了这个:github/Angular他们说我将再次安装npm/Angural cli/node,我运行这个命令来更新我的AngularCLI:
npm卸载@angular/cli
npm 安装 -g @angular/cli@latest
但是首先我用这个命令更新我的npm:
npm install -g npm@latest
但它仍然不起作用。
在我的例子中,这两个命令有帮助:
npm install -g npm@latest
npm install -g @angular/cli
我终于找到了对我有用的东西。
在npm命令末尾添加<code>--force
像npm install--save-dev@angle-devkit/build-角--force
然后< code>ng发球
请尝试在项目文件夹上安装npm。我在全局范围内安装了npm,但在解决方案文件夹上再次安装npm修复了我的问题。
项目文件夹中的< code>npm install将完成此操作。然后做好准备
我得到这个E/flutter(25055)错误时,我正在运行我的应用程序(Flutter, FireBase 我试着更新我的flutter,但仍然得到了相同的日志,这些日志使我的应用程序不稳定,应用程序崩溃了很多 我的颤振医生 C:\src\flatter\bin\flatter。蝙蝠医生——冗长[√] 颤振(通道稳定,2.2.3,在Microsoft Windows[Version 10.0.1
[![const path=需要("path"); const webpack=需要("webpack"); module.exports={模式:"开发",条目:"./src/app.js",输出:{路径:path.resolve(__dirname,"资产","脚本"),文件名:"app.js",公共路径:"./src",}, devServer:{Hot: true, host:"0.0.0
错误:任务“:app:ProcessDebugResources”执行失败。 com.android.ide.common.Process.processException:org.gradle.Process.internal.exeception:Process“command”c:\users\mohamed sallam\appdata\local\android\sdk\build-to
(venv)C:\ Users \ Jay MOH \ PycharmProjects \ Elisanta -Command“C:\ Users \ Jaymoh \ PycharmProjects \ Elisanta \ venv \ Scripts \ python . exe-u-C”导入setuptools,tokenizefile = ' C:\ Users \ Jay MOH \
请参见日志文件2017-11-06 23:34:15下面的代码调试DispatcherServlet:861 -名为“Spring”的DispatcherServlet处理[/Insurance1/]的GET请求17-11-06 23:34:15 WARN page not found:1136-在名为“Spring”的DispatcherServlet中找不到具有URI[/insurace 1/