Is not recognized as an internal or external command operable program or batch file npm run server?

npm run server error . is not recognized as an internal or external command

Questions : npm run server error . is not recognized as an internal or external command

2022-08-01T21:25:27+00:00 2022-08-01T21:25:27+00:00

8775

I came across this issue while running this anycodings_angular project from github anycodings_angular https://github.com/angular-university/reactive-angular-course. anycodings_angular I am running on windows and have all the anycodings_angular latest dependencies, still I am facing this anycodings_angular issue, however on mac it is working fine. anycodings_angular Can anyone please help me with that?

$ npm run server > server > ./node_modules/.bin/ts-node -P ./server/server.tsconfig.json ./server/server.ts '.' is not recognized as an internal or external command, operable program or batch file.

Total Answers 2

33

Answers 1 : of npm run server error . is not recognized as an internal or external command

I had the same issue on a Windows anycodings_windows machine. Adding the full paths to the anycodings_windows start and server scripts in package.json anycodings_windows resolved the issue for me. E.g.,

"start": "C:\\\dev\\\reactive-angular-course\\\node_modules\\\\.bin\\\ng serve --proxy-config C:\\\dev\\\reactive-angular-course\\\proxy.json",<br> "server": "C:\\\dev\\\reactive-angular-course\\\node_modules\\\\.bin\\\ts-node -P C:\\\dev\\\reactive-angular-course\\\server\\\server.tsconfig.json C:\\\dev\\\reactive-angular-course\\\server\\\server.ts",

0

2022-08-01T21:25:27+00:00 2022-08-01T21:25:27+00:00Answer Link

mRahman

5

Answers 2 : of npm run server error . is not recognized as an internal or external command

Adding the full path in package.json as anycodings_windows suggested by @MrMiyagi2201 works. I've anycodings_windows implemented the below changes.

"start": "F:\\reactive\\reactive-angular-course\\node_modules\\.bin\\ng serve --proxy-config F:\\reactive\\reactive-angular-course\\proxy.json", "server": "F:\\reactive\\reactive-angular-course\\node_modules\\.bin\\ts-node -P F:\\reactive\\reactive-angular-course\\server\\server.tsconfig.json F:\\reactive\\reactive-angular-course\\server\\server.ts",

0

2022-08-01T21:25:27+00:00 2022-08-01T21:25:27+00:00Answer Link

miraj

From the scripts section of package.json, this line looks suspect to me:
"serve": "./node_modules/.bin/http-server -c-1 ."

Here's the full output of "npm start":

'.' is not recognized as an internal or external command, operable program or batch file.

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" "run-script" "watch"
npm ERR! node v6.1.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! watch: ./node_modules/.bin/nodemon -V -w src --ext ".ts" --exec "npm run build-app"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the watch script ' ./node_modules/.bin/node mon -V -w src --ext ".ts" --exec "npm run build-app"'.
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 ng2-minimal package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./node_modules/.bin/nodemon -V -w src --ext ".ts" --exec "npm run build-app"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ng2-minimal
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ng2-minimal
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users***\Source\GitHub\ng2-minimal\npm-debug.log
ERROR: watch: None-Zero Exit(1);

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.1.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! start: npm-run-all build-ts build-lib -p watch serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the start script 'npm-run-all build-ts build-lib -p watch serve '.
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 ng2-minimal package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm-run-all build-ts build-lib -p watch serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ng2-minimal
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ng2-minimal
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users***\Source\GitHub\ng2-minimal\npm-debug.log

How do I fix npm is not recognized as an internal or external command?

npm is not recognized as internal or external command operable program or batch file. I figured out that node js is installed in C:\Program Files\nodejs. Opening a command prompt in this directory makes npm work fine.

Is not recognized as an internal or external command npm run?

To solve the error "'concurrently' is not recognized as an internal or external command, operable program or batch file", install the package globally by running npm install -g concurrently , restart your terminal and make sure your PATH environment variable is set up correctly.

Why npm is not working in CMD?

The npm command not found error First, you need to make sure that npm is installed on your computer. npm is bundled with Node. js server, which you can download from the nodejs.org website. Once you downloaded and installed Node.

Why npm install is not working?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.