The command "bin" is not identified as an internal or external command in this npm script

I'm new to using node/npm and encountering an issue when attempting to start an npm script.

Every time I try to execute a simple script like the one below, I get the error message "bin is not recognized as an internal or external command." I have successfully run some previous scripts before, so I'm not sure if my npm installation is faulty or if I made a mistake somewhere.

#! node

const app = require('../lib/app')
const config = {
  port: 8080
}

app.listen(config.port, () => {
  console.log(`Chat is waiting for you at http://localhost:${config.port}`)
})

Screenshot of bin error

I've attempted uninstalling and reinstalling it. I also referred to this post: npm bin command - not recognized as an internal or external command and tried running npm install -g without success.

I am currently using Windows operating system.

Answer №1

Forget about it.

I finally figured out what went wrong. I copied a code snippet from a Linux user that had the "! env node" command on the first line.

Since I'm using Windows, I removed it without realizing that the script was now trying to run "bin/start" instead of "node bin/start".

It may seem like a silly mistake, but hey, at least I've gained some knowledge from it.

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

Having difficulty clearing the npx cache and updating to the latest version of create-react-app, specifically version 5.0.0

I am encountering a similar issue to the one described in this post. I have attempted several solutions, including: npx clear-npx-cache output Need to install the following packages: clear-npx-cache Ok to proceed? (y) y npm uninstall -g create-react-a ...

Running an npm script in a directory containing spaces in the path, utilizing the $npm_package variable

JSON Package File: { "name": "app", "version": "0.1.0", "private": true, "folders": { "plugin": { "dist": "\"/Users/User/Google Drive/App/Dist/plugin\"" } }, "scripts": { "remove_shared_dist": "rm -rf $npm_package_f ...

Showcasing top performers via JavaScript tabs

I have two tabs on my webpage: "Overall Leaderboard" and "Weekly Leaderboard". Each tab displays a leaderboard with different scores. When I click on the "Overall Leaderboard" tab, it shows a leaderboard with specific scores. Now, my question is how can ...

Different ways to verify if a Checkbox is selected within a table

As a newcomer to reactjs, I have a component that renders two tables with different data using the same component and passing data through props. Each table has checkboxes for selection. If a user selects items from both tables, I want to detect if they ha ...

Failure to Generate stats.json File When Building Angular 6 with --stats-json Flag

Currently, I am facing an issue with generating the stats.json file for my Angular 6 application. Despite trying a few different methods, the file is simply not being created. It seems that my system specifically requires "npm run" before every Angular CLI ...

javascript jquery chosen not functioning properly

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>JavaScript</title> </head> <body> <h1 id="hey">List King</h1> <div class="Select-DB"> <select id="DB" class="chosen ...

When using sequential jQuery 'pages', an error referencing the third frame occurs

I am new to using javascript/jquery and have been experimenting with the w3schools tutorials and jquery documentation. I created a page where user input is accepted and javascript prints output based on that input. I tried modifying it to work sequentially ...

React JS: Incorporating Multiple Placeholder Objects within Components

Apologies if this question is a duplicate, but I haven't found any helpful answers yet. I'm new to React and JavaScript. I am looking to include multiple objects inside a component: For example: src={url} name={text} subTitle={subtext} My in ...

Communication between parent and child elements in jQuery

I am developing a plugin that focuses on the manipulation of checkboxes. However, I am currently facing an issue. After retrieving JSON data, I need to establish connections between children and parents. Each child contains a "data-parent" attribute with a ...

Explore all potentialities within an array of objects by examining and contrasting their key values

Looking to run a specific math formula with three parameters using an array of objects in JavaScript. The scenario involves sports, where there are three possibilities: Team A (win), Team B (win), or Draw. There are three different bet websites offering o ...

Can you point me in the direction of the Monaco editor autocomplete feature?

While developing PromQL language support for monaco-editor, I discovered that the languages definitions can be found in this repository: https://github.com/microsoft/monaco-languages However, I am struggling to locate where the autocompletion definitions ...

Updating dynamic content in IBM Worklight V6.1 with jQuery Mobile v1.4.3 requires waiting for the DOM to load

I need to dynamically update the content of a div within my HTML page structure. <!DOCTYPE HTML> <html> ... <body> <div data-role="page"> <div data-role="header"> //Image </div> <!-- Th ...

How to Make WebService Calls in JavaScript in ASP.NET without ScriptManager

I developed a Web service for my Asp.net project. Right now, I am accessing the service through JavaScript by including the Service in ScriptManager. However, I am looking to eliminate the need for a ScriptManager so that I can utilize it on any HTML pag ...

Newly inserted JSON component remains invisible

I am currently using express.js to create an API. My mongoose is returning a JSON object and I need to append an element to each item in the result.docs. This is how I am attempting to achieve that: for(let a in result.docs) { result.docs[a].link ...

How do I automatically redirect a user after they login using react redux?

Currently, I am utilizing react redux in conjunction with Next.js. The goal is to redirect the user to a specific page if they meet certain requirements. I have implemented this logic within my useEffect function and it works as expected. However, upon r ...

Can someone explain the process of utilizing forEach to add elements to an array using React's useState hook?

I'm attempting to replicate the functionality of the code snippet below in a React environment. Despite several attempts, I have not been able to achieve the same outcome. Old code that worked (non-React) const array = [] res = await getData() res. ...

Resetting the selected value in an Angular2 select element after the user makes a change

I have a dropdown menu which the user can select an option from. Initially it has a default value and when the user makes a new selection, I need to ask for confirmation by showing a message "are you sure?". If the answer is NO, then I should revert back t ...

Using pure JavaScript to trigger a pop-up window upon submitting a form

Struggling with sending form data to a PHP page using radio buttons for poll results display. No luck with passing variables using $_POST or $_GET methods. I've checked both, but still nothing. When I tried printing the arrays on the PHP page: <? ...

In Reactjs, you can prevent users from selecting future dates and times by modifying the KeyboardDateTimePicker component

I am currently using the Material UI KeyboardDateTimePicker component and have successfully disabled future dates with the disabledFuture parameter. However, I am now looking for a way to disable future times as well. Any suggestions or solutions would b ...

The hover dropdown remains active even after the mouse has left

I've created a script for displaying a dropdown menu on small screens with a click (or tap on mobile), but I want it to change to hover when the screen size is larger. Here's my code: $(document).ready(function() { var open = false; ...