Hi Team,
Kindly tell how to run installed node js in windows 7.
I have created npm folder then installed node js.
It created npm → bin, docs, lib,man, node_modules,nodejs.
Run it then check the command line output
Your environment has been set up for using Node.js 18.16.0 (x64) and npm.
But there error coming in running node
D:\Users\KBaner10>npm run -start
npm ERR! code EISDIR
npm ERR! syscall read
npm ERR! errno -4068
npm ERR! Could not read package.json: Error: EISDIR: illegal operation on a directory, read
npm ERR! A complete log of this run can be found in: D:\Users\KBaner10\AppData\Local\npm-cache_logs\2023-06-22T05_30_54_123Z-debug-0.log
Log has same details.
Best Regards
Kaushik Banerjee
Hi,
It looks like you’re encountering an error while trying to run a Node.js script using the npm command. The error message “EISDIR: illegal operation on a directory, read” indicates that npm is trying to read a directory as if it were a file, which is causing the issue.
The problem is with the command you’re using: npm run -start
. The correct syntax to run a Node.js script using npm is npm run script-name
. The -start
part is incorrect.
To fix this, make sure you have a valid script defined in the “scripts” section of your package.json
file. For example, if you have a script named “start” defined, you can run it using the following command:
npm run start
Make sure to navigate to the root directory of your Node.js project where the package.json
file is located before running the command.
If you don’t have a “start” script defined, you can add one to your package.json
like this:
"scripts": {
"start": "node your-script.js"
}
Replace “your-script.js” with the actual name of your Node.js script file.
Once you’ve added the “start” script, save the package.json
file, and then try running the script using the correct command:
npm run start
This should execute your Node.js script without any errors.
Issue is the ide cannot run in virtual computer. Node js ran cause I can check version.