The command npm/cucumber - '.' is not recognized as a valid internal or external command

I recently installed npm and it's showing version 9.2.0. But when I try to run the command npm run test, I encounter an error stating that

'.' is not recognized as an internal or external command
. I have double-checked my environment variables, but I'm still unable to identify the cause of this issue.
Here is a snippet of my package.json file:

{
  "name": "udemy_cucumber",
  "version": "1.0.0",
  "description": "practice bdd suite",
  "main": "index.js",
  "scripts": {
    "test": "./node_modules/.bin/cucumber-js --require cucumber.js --require step-definitions/**/*.js -f json:cucumber_report.json --publish-quiet"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@cucumber/cucumber": "^8.11.1",
    "@playwright/test": "^1.30.0",
    "chai": "^4.3.7",
    "cucumber-html-reporter": "^5.5.0",
    "i": "^0.3.7",
    "prettier": "^2.8.4"
  }
}

This is how my folder structure looks like:
https://i.stack.imgur.com/yMdYF.png

If anyone could assist me in identifying what I might have overlooked, I would greatly appreciate it.

Answer №1

After some research, I discovered that the Windows terminal can interpret backslashes to identify folder paths.
To run the command correctly, use:

"test": ".\node_modules\.bin\cucumber-js --require cucumber.js --require step-definitions\**\*.js -f json:cucumber_report.json --publish-quiet"

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

Nested function unable to assign values to variables

I am currently working on a function in Discord.js that collects users who reacted to a message. I have managed to gather all the user IDs inside a nested function, but when trying to return the array to the caller, it does not seem to work as expected. He ...

transitioning from angular cli version 1.7 to version 12

Looking for a detailed guide on upgrading from version 1.7 to the latest Angular version (12/11)? I currently have an app running on version 1.7 and couldn't find a step-by-step process here: upgrading angular Would it be safe to assume that the upgr ...

Is there a caching mechanism for packages in npm?

When I checked my server, it seems that npm is not caching any packages as the cache directory appears to be empty. #www@iZ2zefuufnen6rfx7c81u7Z:~/.npm$ nvm current v9.4.0 # www@iZ2zefuufnen6rfx7c81u7Z:~/.npm$ npm config get cache /home/www/.npm # www@iZ2z ...

Running "vue ui" with Node.js v17.2.0 - A step-by-step guide

After updating to Node.js v17.2.0, I am facing issues with running "vue ui" in my project. The error message I receive indicates a problem with node modules: at Object.readdirSync (node:fs:1390:3) at exports.readdir (/usr/local/lib/node_modules/@vu ...

Angular's ngRoute is causing a redirect to a malformed URL

Currently, I am in the process of developing a single-page application using AngularJS along with NodeJS and Express to serve as both the API and web server. While testing locally, everything was working perfectly fine. However, after cloning the repositor ...

Steps for extracting URL parameters from AWS API Gateway and passing them to a lambda function

After successfully setting up my API gateway and connecting it to my lambda function, I specified the URL as {id} with the intention of passing this parameter into the lambda. Despite numerous attempts using both the default template and a custom one for ...

What have I recently downloaded using NPM?

While attempting to install a package manager called NPM, I encountered an unexpected issue. The command that I entered was: sudo npm install foever -g Due to a typographical error, I mistakenly typed "foever" instead of "forever." Surprisingly, the sy ...

I'm encountering an authentication issue while passing an axios configuration object containing an authorization token. Can anyone provide insight on why this is happening? Using

I am currently developing a small social networking application and have implemented a feature for users to like posts. To ensure security, I have set up an authentication middleware as shown below: const auth = async (req, res, next) => { // check he ...

The electron program is unable to locate the package.json module

I am new to electron and attempting to run an express app for the first time. However, I encountered this error: Need assistance updating code Error: Cannot find module 'C:\package.json' at Module._resolveFilename (module.js:440:15) ...

How can I pass an object into EJS templates from views in Express 3.x?

Currently, I am utilizing ejs templates in combination with node.js and express 3.x. Is there a way to display the data object that is passed into the view? Can it be achieved similar to this example in index.ejs: <%= dump(session) %> ...

The Developer Command Prompt for VS2015 is indicating an error stating that it does not recognize 'npm' as a valid internal or external command

While attempting to run the command npm install –g tsd in Developer Command Prompt for VS2015, I encountered an issue. The prompt displayed: 'npm' is not recognized as an internal or external command, operable program or batch file. Does ...

There seems to be a caching issue in ReactJS and Spring Data Rest that could be causing problems with

Encountering an unusual caching problem here. Just recently wiped out my database. While adding new users to the system, an old user mysteriously reappeared. This user has not been recreated and is not in the current database whatsoever. I'm at a lo ...

The styles for the React calendar are not being properly applied to the calendar component due to CSS overriding

Having trouble overriding the default Calendar.css file in NextJS while creating a calendar component. Even after adding my own custom styles, they aren't being applied. Deleting the css file contents doesn't change the format either. Only when c ...

Which repository is generating this error message?

After discovering an error message, I'm curious to know which repository is responsible for its creation. My intention is to submit a PR to update it. Despite cloning the create-react-app and Babel repositories, I was unable to find any results usi ...

Utilizing selenium to input text values in robot framework

Using Robot Framework with Selenium 2.0, I have created a test that fills out a form and saves it. However, the issue I am facing is that when entering numeric values into text boxes, the default value of 0.0 is not being cleared. This results in the new v ...

Passing an object from an Angular application to a backend server in Node.js using the

I have a YAML file with the following structure: Layouts: - Name: Default Layout LayoutId : 1 ConfiguredSegments: LiveA : Height : 100 Id : LiveA Ref1A : ...

Developing a collection of reusable components in a Javascript bundle for enhanced efficiency

I currently have a backend rendered page (using Django) that I want to enhance by incorporating components from PrimeVue and a markdown editor wrapped as a Vue component. Previously, we utilized some simple animations with jQuery which we included directly ...

Having trouble updating the environmental variable file using newman in NodeJS when running multiple collections simultaneously

While running multiple collections in NodeJs using Postman, I encountered an issue with sharing the clientHandshakeToken variable set in the first collection across subsequent collections. Despite my attempts to use Newman for this purpose, the second coll ...

When in development mode, opt for the unminified version of the library in Web

My TypeScript project utilizes a forked version of the apexcharts npm package. When building the project with webpack in development mode, I want to use the unminified version of the apex charts library. However, for production, I prefer to stick with the ...

Use `Res.download()` to send data to the client instead of directly downloading the file

I am trying to transfer a file that has been created by my NodeJS server from the server to the client for download. Users input object data which is then stored in a database. The function responsible for creating the file will read these objects and pop ...