After reading many ( if not all :-| ) posts having similar problems, I still don't have a working local (or a "global") install of node.js's Mac OSX system tools. Showing global attempt here...
Their doc implies either an npm install or a build from source - but not npm THEN source. However, a test run seems to be requiring compiled file(s) that don't exist after the attempted install.
Details:
It's my understanding that npm should be sufficient, but when I do the recommended
sudo npm install -g osx
npm creates /usr/local/lib/node_modules and populates with
README.md osx.cc osx.js package.json wscript
Running (from anywhere) node theirSample.js, containing:
Var osx = require('osx');
// also tried full path as recommended in other answers
var osx = require('/usr/local/lib/node_modules/osx');
The error is the commonly seen "cannot find module". However, the specific error is:
Cannot find module './build/Release/osx'
Which stems from the above osx.js created in /usr/local/lib/node_modules That file has the errant line:
var osx = require('./build/Release/osx');
That implies that I need the ./build/Release/osx dir, but npm did not create this under the modules dir. So does that mean I need to compile the source? If so, any pointers on set up please.
First of all, you don't need to install it globally, and second, this module is already 2 years old, and it was tested on Darwin 11.2. It does not work with OS X "Mavericks" - just tested on my machine.
As a replacement, I would recommend to take a look at os build-in module, which provides basic operating-system related utility functions, and is OS-agnostic
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments