The error `npm run server` is not able to recognize the command '.' as an internal or external command

While working on my project from github https://github.com/angular-university/reactive-angular-course, I encountered an issue. Even though I have all the latest dependencies and am running on Windows, I am facing this problem. Interestingly, it works fine on a Mac. Can anyone assist me with resolving this?

$ npm run server

> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6311060200170a15064e020d04160f02114e000c1611100623534d534d53">[email protected]</a> 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.

Answer №1

Encountered a similar issue while working on a Windows system. To resolve it, I included the complete paths to the start and server scripts within the package.json. For example:

"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",

Answer №2

By following @MrMiyagi2201's advice, I have successfully included the complete path in the package.json. Here are the modifications I made:

"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",

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

You cannot use ca.select(....).from function after the code has been minified

My Angular application utilizes squel.js and functions correctly in development mode. However, upon building the app for production and attempting to use it, I encounter the following error message: ca.select(...).from is not a function This error ref ...

Having trouble installing dependencies through npm while constructing a docker image

When building an image from a Dockerfile, I encountered an error during the npm installation part of the process. Strangely, I can run the commands successfully outside of the image build environment. The source of this error is still unknown to me. I am ...

Why are there so many modules being installed with `npm install` when I only need to install two?

Here is my package.json configuration: { "private": true, "devDependencies": { "gulp": "^3.9.0", "laravel-elixir": "*" "bootstrap-sass": "^3.0.0" } } After running npm install, I ended up with a whopping 800 modules ranging from "abbrev ...

Preventing users from entering past dates in Angular 6 - A step-by-step guide

Here is my current code snippet: ngOnInit() { let now = new Date(); this.date = formatDate(now, "dd/mm/yyyy",'en-US'); console.log("dateFormat :",this.date); } This is the html part of my code: <input type="date" [min]={{da ...

Error encountered while attempting to install react-router-dom package using npm

Despite multiple attempts, I am struggling to successfully install react-router-dom in my react project. Every time I try, I encounter the following error: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @mater ...

Tips on how to dynamically uncheck and check the Nebular checkbox post-rendering

I incorporated a nebular theme checkbox into my Angular 8 App. <nb-checkbox [checked]="enable_checked" (checkedChange)="enable($event)">Enable</nb-checkbox> I am able to update the checkbox using the Boolean variable "enable_checked". Initia ...

When attempting to run my initial truffle file, encountering an error stating "Module 'babel-register' not

Currently, I am in the process of constructing the marketplace decentralized application (dapp) tutorial created by Dapp University on YouTube. However, when I run truffle compile, an error is thrown with the message: Error: Cannot find module 'babel ...

One of the Amplify and AWS files that seems to be missing is the "aws-exports" module

Recently, a company interested in hiring me sent over a "trial project" to work on. It was supposed to be simple, but it required the use of Amplify and AWS. The CTO specified that I needed to have a specific version of Node (10.18.1 or 10.19.0) and instru ...

Is the "node_modules" directory taking up too much space?

After running npx create-react-app, a node-modules folder is generated, which can be quite large at over 150 mb. I don't want this heavy folder to be created each time I start a new React project. Is there a way to avoid this issue and use React witho ...

npm is unable to locate the npm-cli module following the upgrade to Yosemite

After updating my OS X to Yosemite, I encountered an error when trying to run npm: module.js:340 throw err; ^ Error: Cannot find module '/usr/local/lib/node_modules/npm/bin/node_modules/npm/bin/npm-cli.js' at Function.Module._re ...

The canActivate: [AuthGuard] feature on the external router is not functioning as expected

I'm encountering an issue with my routing. I attempted to use the following code: const routes: Routes = [ { path: 'home', component: HomeComponent, canActivate: [AuthGuard], children: [ { path: 'events', component: Ev ...

Error Arises When Making Selection in PrimeNG's P-ListBox Component

Whenever I choose an item from my listbox module, I encounter an error where the value is being returned as an object instead of an array in my listbox.js file from p-listbox by PrimeNG. HTML: <p-listbox formControlName="programType" [options]="phoneT ...

Is there a way to easily toggle a Material Checkbox in Angular with just one click?

Issue with Checkbox Functionality: In a Material Dialog Component, I have implemented several Material Checkboxes to serve as column filters for a table: <h1 mat-dialog-title>Filter</h1> <div mat-dialog-content> <ng-container *ng ...

What is the reason for nodes npm running local scripts specified in package.json?

As a newcomer to Node.js, I have observed that the npm package manager is responsible for initiating and running programs specified in the package.json file. I've been curious about the historical rationale behind this design choice. Can someone shed ...

To optimize your bundling process, include the leaflet.css file from the node_modules/leaflet directory using webpack

Currently, I am working on developing a map application using webpack and leaflet. While I can successfully require leaflet.js from my map.js file, I encounter an error when trying to call leaflet.css. The configuration in my webpack.config.js is as follo ...

issues encountered in npm installation process

Recently, I encountered an issue while attempting to install packages using npm. Unfortunately, the process seems to be stuck and the packages are not getting downloaded properly. Below is a snippet of the installation process with the --verbose flag enabl ...

The AWS Beanstalk CLI continues to deploy React and npm development builds

I have a React application along with two AWS Beanstalk instances: one for development and the other for production. My goal is to deploy the development build of the React app to the development environment and the production build to the production envir ...

Can classes from an external package be imported into an Angular library within an Angular app using Openlayers?

I am currently developing an Angular library that configures an OpenLayers map as an Angular component. The component is functioning properly, but I need to access classes and constants from a package imported by the library, specifically OpenLayers. To w ...

An issue occurred: the channel has been terminated within the ChildProcess.target.send function at internal/child_process.js, line 562, character

My Angular 5 application is giving me an error message that says "ERROR in Error: channel closed". This occurs after running the application. The issue seems to persist even though it works fine for a few minutes after executing ng serve. Has anyone else e ...

Resolving undefined in Ionic 4: Returning Data from Modal

I'm attempting to create a modal window that utilizes a radio group. When a user selects a value from the radio group, I want the modal to return the selected object. Here is the code for the radio group page and HTML: export class PopoverstationsPa ...