最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

为什么我在node

运维笔记admin13浏览0评论

为什么我在node

为什么我在node

我从angular.io下载了一个示例项目,从这里.zip

并在根文件夹中运行npm install,如本教程中所示

虽然我在node_modules和package.json中都有相应的角度包,但我仍然得到了这个:

Hash: faeff28da7a6ba00851d                    
Time: 8547ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 171 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 5.41 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 11.5 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.18 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in /home/ivan/anglr-lrn/src/app/appponent.ts (1,27): Cannot find module '@angular/core'.

ERROR in /home/ivan/anglr-lrn/src/app/appponent.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 /home/ivan/anglr-lrn/src/app/app.module.ts (1,31): Cannot find module '@angular/platform-browser'.

ERROR in /home/ivan/anglr-lrn/src/app/app.module.ts (2,26): Cannot find module '@angular/core'.

ERROR in /home/ivan/anglr-lrn/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 /home/ivan/anglr-lrn/src/main.ts (1,32): Cannot find module '@angular/core'.

ERROR in /home/ivan/anglr-lrn/src/main.ts (2,40): Cannot find module '@angular/platform-browser-dynamic'.

ERROR in Could not resolve module @angular/core
webpack: Failed to compile.
webpack: Compiling...
Hash: faeff28da7a6ba00851d                                               
Time: 807ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 171 kB {4} [initial]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 5.41 kB {3} [initial]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 11.5 kB {4} [initial]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.18 MB [initial]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry]

ERROR in /home/ivan/anglr-lrn/src/app/appponent.ts (1,27): Cannot find module '@angular/core'.

ERROR in /home/ivan/anglr-lrn/src/app/appponent.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 /home/ivan/anglr-lrn/src/app/app.module.ts (1,31): Cannot find module '@angular/platform-browser'.

ERROR in /home/ivan/anglr-lrn/src/app/app.module.ts (2,26): Cannot find module '@angular/core'.

ERROR in /home/ivan/anglr-lrn/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 /home/ivan/anglr-lrn/src/main.ts (1,32): Cannot find module '@angular/core'.

ERROR in /home/ivan/anglr-lrn/src/main.ts (2,40): Cannot find module '@angular/platform-browser-dynamic'.
webpack: Failed to compile.
回答如下:

这在类似的情况下工作:

在您的计算机上卸载NodeJS。

如果与可下载的软件包安装程序一起安装 - (添加删除程序>选择NodeJS并单击卸载)

下载并安装NodeJS 6.10.3(https://nodejs/dist/v6.10.3/node-v6.10.3-x64.msi)

清理node_modules文件夹

rm -rf node_modules/

清理任何临时文件夹

运行这些命令

npm uninstall -g angular-cli
npm cache clean
npm install -g @angular/cli
npm install

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论