gpt4 book ai didi

Git Pull 后 Angular CLI 项目缺少模块错误

转载 作者:行者123 更新时间:2023-12-05 07:41:26 27 4
gpt4 key购买 nike

我在 Angular/CLI 1.2.1 中使用 Angular4。我能够很好地初始化并使用 ng serve 在本地运行应用程序。但是,在推送到远程 git 存储库然后将我的工作拉到另一台机器上后 - 我收到错误。

重建步骤
1. 从远程 git 仓库中拉取使用 Angular CLI 创建的项目。
2. NPM安装。
3. 服务。

错误信息

ERROR in D:/application/src/app/app.component.ts (1,27): Cannot find module '@angular/core'.

ERROR in D:/application/src/app/app.component.ts (8,14): Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

ERROR in D:/application/src/app/app.module.ts (1,31): Cannot find module '@angular/platform-browser'.

ERROR in D:/application/src/app/app.module.ts (2,26): Cannot find module '@angular/core'.

ERROR in D:/application/src/app/app.module.ts (16,14): Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

ERROR in D:/application/src/main.ts (1,32): Cannot find module '@angular/core'.

ERROR in D:/application/src/main.ts (2,40): Cannot find module '@angular/platform-browser-dynamic'.

ERROR in Could not resolve module @angular/core

ERROR in D:/application/src/main.ts (1,32): Cannot find module '@angular/core'.

ERROR in D:/application/src/main.ts (2,40): Cannot find module '@angular/platform-browser-dynamic'.

ERROR in D:/application/src/app/app.module.ts (1,31): Cannot find module '@angular/platform-browser'.

ERROR in D:/application/src/app/app.module.ts (2,26): Cannot find module '@angular/core'.

ERROR in D:/application/src/app/app.module.ts (16,14): Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

ERROR in D:/application/src/app/app.component.ts (1,27): Cannot find module '@angular/core'.

ERROR in D:/application/src/app/app.component.ts (8,14): Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

webpack: Failed to compile.

NPM 安装输出

npm WARN prefer global node-gyp@3.6.2 should be installed with -g

node-sass@4.5.3 install D:\application\node_modules\node-sass node scripts/install.js

缓存二进制文件位于 C:\Users\user\AppData\Roaming\npm-cache\node-sass\4.5.3\win32-x64-48_binding.node

node-sass@4.5.3 postinstall D:\application\node_modules\node-sass node scripts/build.js

二进制文件位于 D:\application\node_modules\node-sass\vendor\win32-x64-48\binding.node测试二进制文件二进制没问题

...继续安装,没有错误(包括@angular/core 和其他包)。

最佳答案

从 Angular 项目层次结构中删除 node_modules 文件夹并使用 npm install 重新安装所有包的简单方法

关于Git Pull 后 Angular CLI 项目缺少模块错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45337324/

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