0

I got a problem when I input any npm cmd, it says

internal/modules/cjs/loader.js:584

Operating System: Windows 8 pro 64bit

What shall I do to solve this issue?enter image description here

1 Answers1

1

Your error message of:

Error: Cannot find module 'C:\Users\NUMAN ALI\myfirst.js'

indicates that Node can't find your myfirst.js file to run within your current directory of: C:\Users\NUMAN ALI. Your myfirst.js file isn't located within this directory so you need to move into the correct directory containing this file, or alternatively create this file in the current directory. Then you need to add your desired JavaScript within this file to run it.

With your comment of: "The file you have just created must be initiated by Node.js before any action can take place" I am going to assume you don't have this file in your current directory. Maybe you could try creating the file in a text editor, such as notepad at the very least on a Windows machine, and adding the JavaScript contents into this file. Then try re-running the file with a node myfirst.js. Check out this accepted answer here as I think this will help you out a lot. Also, for command line help for creating files, check out this link.

Hopefully that helps!

Nathan
  • 5,792
  • 4
  • 14
  • 39