2017-10-23 19 views
1

この問題を解決する方法ここで私は7 64ビットのウィンドウで問題を再現する必要があります。 私はWindows 7でnodejsをインストールし、私はWindows 7でreslove npmの開始エラーが発生する

NPMバージョン

'CALL "C:\Program Files\nodejs\\node.exe" 
"C:\ProgramFiles\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g' 
    is not recognized as an internal or external command,operable program or batch file. 
{ 'angular-quickstart': '1.0.0', 
    npm: '3.10.10', 
    ares: '1.10.1-DEV', 
     http_parser: '2.7.0', 
     icu: '58.2', 
    modules: '48', 
    node: '6.11.4', 
    openssl: '1.0.2l', 
    uv: '1.11.0', 
    v8: '5.1.281.108', 
    zlib: '1.2.11' } 

そして私を入力したコマンドプロンプトを開き、私はNPMをインストールするときに、私は角度のjsをインストールするプロジェクトフォルダを作成し、その作業罰金が、私

E:\project\Demo>npm start 
    'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules 
    \npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command, 
    operable program or batch file. 

    > [email protected] prestart E:\project\Demo 
    > npm run build 


    npm ERR! Windows_NT 6.1.7601 
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
    npm ERR! node v6.11.4 
    npm ERR! npm v3.10.10 
    npm ERR! file C:\Windows\system32\cmd.exe;C:\xampp\php; 
    npm ERR! path C:\Windows\system32\cmd.exe;C:\xampp\php; 
    npm ERR! code ELIFECYCLE 
    npm ERR! errno ENOENT 
    npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\xampp\php; 
    npm ERR! [email protected] prestart: `npm run build` 
    npm ERR! spawn C:\Windows\system32\cmd.exe;C:\xampp\php; ENOENT 
    npm ERR! 
    npm ERR! Failed at the [email protected] prestart script 'npm run build'. 

     npm ERR! Make sure you have the latest version of node.js and npm installed. 
     npm ERR! If you do, this is most likely a problem with the angular-quickstart package, 
    npm ERR! not with npm itself. 
    npm ERR! Tell the author that this fails on your system: 
    npm ERR!  npm run build 
    npm ERR! You can get information on how to open an issue for this project with: 
    npm ERR!  npm bugs angular-quickstart 
    npm ERR! Or if that isn't available, you can get their info via: 
    npm ERR!  npm owner ls angular-quickstart 
    npm ERR! There is likely additional logging output above. 
    npm ERR! Windows_NT 6.1.7601 
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" 
    "C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
    npm ERR! node v6.11.4 
    npm ERR! npm v3.10.10 
    npm ERR! code ELIFECYCLE 

    npm ERR! [email protected] prestart: `npm run build` 
    npm ERR! Exit status -4058 
    npm ERR! 
    npm ERR! Failed at the [email protected] prestart script 'npm run build'. 

    npm ERR! Make sure you have the latest version of node.js and npm installed. 
    npm ERR! If you do, this is most likely a problem with the angular-quickstart package, 
    npm ERR! not with npm itself. 
    npm ERR! Tell the author that this fails on your system: 
    npm ERR!  npm run build 
    npm ERR! You can get information on how to open an issue for this project with: 
    npm ERR!  npm bugs angular-quickstart 
    npm ERR! Or if that isn't available, you can get their info via: 
    npm ERR!  npm owner ls angular-quickstart 
    npm ERR! There is likely additional logging output above. 

    npm ERR! Please include the following file with any support request: 
    npm ERR!  E:\project\Demo\npm-debug.log 

パッケージJSON

のようなコマンドを与えられています npm startはあなたがCMDで SETを使用して環境変数内のノードのための bower.json

チェックを持っている場合は、あなたのpackage.jsonbower iを実行さレベル@npm iを実行する前に実行している

{ 
    "name": "angular-quickstart", 
"version": "1.0.0", 
"description": "QuickStart package.json from the documentation, supplemented with testing support", 
    "scripts": { 
    "build": "tsc -p src/", 
    "build:watch": "tsc -p src/ -w", 
    "build:e2e": "tsc -p e2e/", 
    "serve": "lite-server -c=bs-config.json", 
    "serve:e2e": "lite-server -c=bs-config.e2e.json", 
    "prestart": "npm run build", 
"start": "concurrently \"npm run build:watch\" \"npm run serve\"", 
"pree2e": "npm run build:e2e", 
"e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first", 
"preprotractor": "webdriver-manager update", 
"protractor": "protractor protractor.config.js", 
"pretest": "npm run build", 
"test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"", 
"pretest:once": "npm run build", 
"test:once": "karma start karma.conf.js --single-run", 
"lint": "tslint ./src/**/*.ts -t verbose" 
    }, 
"keywords": [], 
"author": "", 
"license": "MIT", 
"dependencies": { 
"@angular/common": "~4.3.4", 
"@angular/compiler": "~4.3.4", 
"@angular/core": "~4.3.4", 
"@angular/forms": "~4.3.4", 
"@angular/http": "~4.3.4", 
"@angular/platform-browser": "~4.3.4", 
"@angular/platform-browser-dynamic": "~4.3.4", 
"@angular/router": "~4.3.4", 

"angular-in-memory-web-api": "~0.3.0", 
"systemjs": "0.19.40", 
"core-js": "^2.4.1", 
"rxjs": "5.0.1", 
    "zone.js": "^0.8.4" 
    }, 
"devDependencies": { 
"concurrently": "^3.2.0", 
"lite-server": "^2.2.2", 
"typescript": "~2.1.0", 

"canonical-path": "0.0.2", 
"tslint": "^3.15.1", 
"lodash": "^4.16.4", 
"jasmine-core": "~2.4.1", 
"karma": "^1.3.0", 
"karma-chrome-launcher": "^2.0.0", 
"karma-cli": "^1.0.1", 
"karma-jasmine": "^1.0.2", 
"karma-jasmine-html-reporter": "^0.2.2", 
"protractor": "~4.0.14", 
"rimraf": "^2.5.4", 
"@types/node": "^6.0.46", 
"@types/jasmine": "2.5.36" 
    }, 
    "repository": {} 
} 
+0

あなたのPCに 'node'をインストールしましたか? [こちらをチェック](https://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8)。あなたの環境変数にnpm/nodeが追加されていない可能性があります –

+0

ここで私の環境パスが自分のシステムに追加されていることを確認しました。パス; C:\ Program Files \ nodejs \。これが私が追加したパスです。 – vallavan

答えて

0

+0

同じエラーが表示されます.. – vallavan

+0

'CALL "C:¥Program Files¥nodejs¥¥node.exe" C:¥Program Files¥nodejs¥¥node_modules \ npm \ bin \ npm-cli.js "接頭辞-g 'は内部または外部のcom mand、 操作可能なプログラムまたはバッチファイルとして認識されません。エラー – vallavan

+0

どのようにノードをインストールしましたか? via .exe or command line –

0

github上にthis issueが見つかりました。どうやら、このエラーは、環境変数に間違いがある場合に表示されます。ウィンドウでPATH変数を開き、ダイアログウィンドウに奇妙なセミコロンやフラグがあるかどうか確認してください:

dialog window

もしそうなら、修正してもう一度やり直してください

関連する問題