I have tried this code in meteor js but it will display error "TypeError: Object #Object> has no method 'parse'"
path = Npm.require('path')
filename = path.parse('/home/user/dir/file.txt')
The docs default to the current version of node, however meteor typically uses and older version. You can determine which version of node meteor is currently running by looking at the changelog. For
v.22.214.171.124 it's node
v0.10.33. You can access the old docs here:
As you can see, the older version of
path did not have the
parse function. You can also see this via:
If you want to know what version you are using, this post will help you : How can I know the version of node being used by my meteor app?