簡體   English   中英

angular-cli:ng新的my-dream-app錯誤

[英]angular-cli: ng new my-dream-app error

我正在嘗試使用Angular CLI創建新的Angular 2應用程序,但出現錯誤。

這是我想收集的信息:

版本信息

當我跑步時:

ng version

我得到:

(node:3184) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
angular-cli: 0.1.0
node: 6.1.0
os: win32 x64

錯誤信息

當我跑步時:

ng new my-dream-app

我得到:

(node:176) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Cannot find module 'config-chain'
Error: Cannot find module 'config-chain'
    at Function.Module._resolveFilename (module.js:438:15)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\work\AppData\Roaming\npm\node_modules\angular-cli\node_modules\npm\lib\config\core.js:2:10)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)

提前致謝

嘗試這個:

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

我已經看到,當我嘗試將webdriver-manager作為非全局NPm依賴項安裝到Angular CLI生成的項目中時。

因此,根據我的環境和嘗試以及您的嘗試和問題中所寫版本之間的差異,可以嘗試以下幾件事。

  • 忽略“ node:88754”,這是一個可以繞開的安全方法

  • 將NPM升級到最新版本,對我來說是3.9.0

     npm update -g npm 
  • 嘗試全局安裝“ webdriver-manager”

     npm install -g webdriver-manager 

    當前NPM存在一些問題,可能會導致您出錯。 當前的解決方法是重試幾次:(

  • 更新Angular CLI版本(我說“ 1.0.0 -beta.1 ”)

     npm install -g angular-cli 

    確保ng --version返回等於或高於我的值。

不知道這是否會為您100%修復,但是我們可以從那里拿來看看您能得到什么。

使用cmd卸載angular-cli: npm卸載angular-cli並使用cmd重新安裝: npm install -g angular-cli

希望對您有所幫助。

很大的幫助!!! 謝謝。 嘗試創建角度項目時,我在控制台上收到了此消息。 ng新的英雄之旅...。然后,我得到這個錯誤:

錯誤:找不到模塊'source-map-resolve'......

我嘗試這個,它的工作原理。

npm卸載-g angular-cli npm緩存清理npm install -g angular-cli @ latest

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM