I am writing a 'myPackage' meteor packet, which should write a file to disk using the Npm FileSystem and Pah modules. The file should end in the example-app / packages / myPackage / auto_generated / myFile.js, where the sample application is added by myPackage.
fs = Npm.require( 'fs' ) ; path = Npm.require( 'path' ) ; Meteor.methods( { autoGenerate : function( script ) { var myPath = '/Users/martinfox/tmp/auto-generated' ; var filePath = path.join(myPath, 'myFile.js' ) ; console.log( filePath ) ;
When I run the code above (server side only) I get
Exception while invoking method 'autoGenerate' Error: ENOENT, no such file or directory '/Uses/martinfox/tmp/auto-generated/myFile.js'
Note / Usage / martinfox / tmp / automatically created folder exists
- Any ideas what is going wrong?
- Is it possible to get an absolute path to the catalog of meteor projects?
source share