I tried renaming my file to test.js and ran the command node test.js , However, I still get this error when I run it:
Error: Cannot find module 'johnny-five'
Require stack:
- C:\Users\HP\Documents\GitHub\NODE\test.js
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:962:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:838:27)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:1022:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:72:18)←[39m
at Object.<anonymous> (C:\Users\HP\Documents\GitHub\NODE\test.js:1:14)
←[90m at Module._compile (internal/modules/cjs/loader.js:1118:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:982:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:875:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: [ ←[32m'C:\\Users\\HP\\Documents\\GitHub\\NODE\\test.js'←[39m ]
}
It says it can't find the johnny-five module but i've already installed it.