在Windows 7中重新启动npm启动错误

如何解决这个问题。 在这里,我需要重新解决这个问题在Windows 7 64位。 我在Windows 7中安装nodejs并打开我input的命令提示符

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' } 

而我创build项目文件夹我安装angularjs时,我安装npm其工作正常,但我给了像这样的命令

  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. > angular-quickstart@1.0.0 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! angular-quickstart@1.0.0 prestart: `npm run build` npm ERR! spawn C:\Windows\system32\cmd.exe;C:\xampp\php; ENOENT npm ERR! npm ERR! Failed at the angular-quickstart@1.0.0 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! angular-quickstart@1.0.0 prestart: `npm run build` npm ERR! Exit status -4058 npm ERR! npm ERR! Failed at the angular-quickstart@1.0.0 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

  { "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": {} } 

我在github上发现了这个问题 。 显然,如果你的环境variables有错误,就会出现这个错误。 在窗口上打开PATHvariables,并检查对话窗口中是否有任何奇怪的分号或标志:

对话窗口

如果是的话,修复它们,然后再试一次

在运行npm start之前,先执行npm i @ level,如果你有你的package.json也执行bower i如果你有bower.json

在cmd中使用SET检查环境variables中的节点。