简体   繁体   中英

reslove npm start error in windows 7

How to reslove this problem. Here I need to reslove the problem in the window os 7 64 bit. I installed nodejs in windows 7 And I open command prompt I entered

npm version

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

And I created project folder I install angular js when i install the npm its working fine but I am given the command like

 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

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

Before running npm start execute npm i @ level where you have your package.json also execute bower i if you have bower.json

check for node in environment variables using SET in cmd.

I found this issue on github. Apparently, this error appears if there is a mistake in your environment variables. Open your PATH variable on windows and check if there are any strange semicolons or flags in the dialog window:

对话视窗 .

If so, fix them and try again

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM