Git Pull

时间:2017-07-26 20:59:19

标签: angular angular-cli

我在Angular / CLI 1.2.1中使用Angular4。我能够初始化精细并使用ng服务在本地运行应用程序。然而,在推送到远程git仓库然后在另一台机器上拉下我的工作后 - 我得到了错误。

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

错误消息

  

D中的错误:/application/src/app/app.component.ts(2,27):找不到   模块' @ angular / core'。

     

D中的错误:/application/src/app/app.component.ts(8,14):实验   对装饰器的支持是一个可以在a中更改的功能   未来发布。设置'experimentalDecorators'删除此选项   警告。

     

D中的错误:/application/src/app/app.module.ts(1,31):找不到   模块' @ angular / platform-b​​rowser'。

     

错误在D:/application/src/app/app.module.ts(2,22):找不到   模块' @ angular / core'。

     

D中的错误:/application/src/app/app.module.ts(16,14):实验   对装饰器的支持是一个可以在a中更改的功能   未来发布。设置'experimentalDecorators'删除此选项   警告。

     

D中的错误:/application/src/main.ts(1,32):找不到模块   ' @角/核心'

     

D中的错误:/application/src/main.ts(2,40):找不到模块   ' @角/平台的浏览器的动态'

     

ERROR in无法解析模块@ angular / core

     

D中的错误:/application/src/main.ts(1,32):找不到模块   ' @角/核心'

     

D中的错误:/application/src/main.ts(2,40):找不到模块   ' @角/平台的浏览器的动态'

     

D中的错误:/application/src/app/app.module.ts(1,31):找不到   模块' @ angular / platform-b​​rowser'。

     

错误在D:/application/src/app/app.module.ts(2,22):找不到   模块' @ angular / core'。

     

D中的错误:/application/src/app/app.module.ts(16,14):实验   对装饰器的支持是一个可以在a中更改的功能   未来发布。设置'experimentalDecorators'删除此选项   警告。

     

D中的错误:/application/src/app/app.component.ts(2,27):找不到   模块' @ angular / core'。

     

D中的错误:/application/src/app/app.component.ts(8,14):实验   对装饰器的支持是一个可以在a中更改的功能   未来发布。设置'experimentalDecorators'删除此选项   警告。

     

webpack:无法编译。

NPM安装输出

npm WARN首选全局node-gyp@3.6.2应与-g

一起安装
  

node-sass@4.5.3安装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和其他包)。

3 个答案:

答案 0 :(得分:0)

轻松地从角度项目层次结构中删除node_modules文件夹,并使用npm install重新安装所有软件包的简便方法

答案 1 :(得分:0)

转到终端中的项目文件夹,然后输入npm rebuild

如果您的node_modules不存在或没有所需的所有依赖项,请删除并运行npm install

请参考此线程:How to run "npm install" to create node_modules folder for an older Angular project?

答案 2 :(得分:0)

尝试删除package-lock.json文件,然后安装node_modules npm install