gpt4 book ai didi

angular - 内部/模块/cjs/loader.js :883 throw err

转载 作者:行者123 更新时间:2023-12-03 14:37:21 28 4
gpt4 key购买 nike

我遇到了运行 npm start 的问题(我在我的 Angular 项目中附上了错误的截图)。
当我使用 ng serve 运行项目时,一切正常。
我尝试了几种方法来解决此问题,但均未成功。
Screenshot of the error
这是我的package.json文件:

{
"name": "myapplication",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~11.0.6",
"@angular/common": "~11.0.6",
"@angular/compiler": "~11.0.6",
"@angular/core": "~11.0.6",
"@angular/forms": "~11.0.6",
"@angular/platform-browser": "~11.0.6",
"@angular/platform-browser-dynamic": "~11.0.6",
"@angular/router": "~11.0.6",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1100.6",
"@angular/cli": "~11.0.6",
"@angular/compiler-cli": "~11.0.6",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.0.2"
}
}

最佳答案

在这个问题上花了很多时间后,我终于找到了解决方案。
我已经卸载了 “NodeJs”完全,删除 “NPM” & “NPM 缓存”从:

C:\Users\username\AppData\Roaming
并重新启动PC。然后我重新安装了所有东西。

如果问题仍然存在,请检查您的文件夹名称。
在我的例子中,Angular 项目位于一个名为 的文件夹中。 《研发》 :
C:\Users\Asus\Documents\Research & Development\Video conference project\myapplication
我删除了特殊字符 "&"并将文件夹重命名为 《研究-发展》
改名后, npm start执行没有错误。
Command line screenshot

关于angular - 内部/模块/cjs/loader.js :883 throw err,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65653417/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com