0

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)

前もって感謝します

4

4 に答える 4

3

これを試して:

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
于 2016-06-17T11:00:14.263 に答える
1

Angular CLI によって生成されたプロジェクトに webdriver-manager を非グローバル NPm 依存関係としてインストールしようとしたとき、私はそれを見ました。

したがって、私の環境と試行の違い、およびあなたの試行と質問に書かれたバージョンに基づいて、いくつかのことを試してみてください。

  • 「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% 修正されるかどうかはわかりませんが、そこから取得して結果を確認できます。

于 2016-05-13T02:42:18.703 に答える
0

cmd: npm uninstall angular-cliで angular-cli をアン インストールし、cmd: npm install -g angular-cliで再インストールします。

あなたを助けるホップ。

于 2016-06-03T13:27:29.397 に答える