0

I have been able to run my file in the terminal. When I run my file in vim editor using:

:! node % 

I get the following error message:

Cannot find module.

It seems vim does not know how to locate the file on my system. What commands should I be using to run the file? Thanks!

romainl
  • 186,200
  • 21
  • 280
  • 313
user3316598
  • 163
  • 1
  • 7
  • When you do `:!`, `` happens outside of Vim, in a shell where Vim has no say on anything. This means that the error a) is not reported by Vim but, presumably, by node, and b) that the error is caused by something in your code or in your node install or in your environment. Either way, your problem is unrelated to Vim. See https://stackoverflow.com/questions/9023672/how-do-i-resolve-cannot-find-module-error-using-node-js. – romainl Nov 29 '22 at 10:13
  • As I stated in the question the program works without vim. – user3316598 Nov 29 '22 at 10:21
  • Vim is not able to find the file properly for some reason. – user3316598 Nov 29 '22 at 10:22
  • Again, Vim has nothing to do with this. It is Node that is complaining about a missing module, not Vim. – romainl Nov 29 '22 at 10:32

0 Answers0