ahmad almasri
ahmad almasri

Reputation: 57

internal/modules/cjs/loader.js:892 nodejs file

I can't run the node.js file internal/modules/cjs/loader.js:892

lenovo@DESKTOP-2CQ3JSF MINGW64 /c/xampp/htdocs/laravel (master)
$ node c:\xampp\htdocs\laravel\public\js\server.js
internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'c:\xampp\htdocs\laravel\xampphtdocslaravelpublicjsserver.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

someone help me

Upvotes: 0

Views: 893

Answers (1)

vsemozhebuty
vsemozhebuty

Reputation: 13822

Your terminal considers \ symbol as an escape symbol, not as a directory delimiter — 'xampphtdocslaravelpublicjsserver.js' is a hint. Try to use quotes, or double backslashes, or slashes instead of backslashes:

node "c:\xampp\htdocs\laravel\public\js\server.js"

or:

node c:\\xampp\\htdocs\\laravel\\public\\js\\server.js

or:

node c:/xampp/htdocs/laravel/public/js/server.js

Upvotes: 1

Related Questions