Closed jwulf closed 9 years ago
install clone module... Now i see that it is declared in package.json so I donțt see whay it is crushing for you
sitapati@MacBook-Air [~/workspace/SwarmCore] $ node
var clone=require('clone') undefined clone { [Function: clone] clonePrototype: [Function: clonePrototype], objToStr: [Function: objToStr], isDate: [Function: isDate], isArray: [Function: isArray], isRegExp: [Function: isRegExp], getRegExpFlags: [Function: getRegExpFlags] }
Ah, it's because it is not declared in swarmutil package.json. That's where it is being included from.
Benchmark.js has:
var util = require("swarmutil");
~/node_modules/swarmutil/lib/SwarmUtils.js has:
var clone = require('clone');
swarmutil package.json has:
"_id": "swarmutil@1.1.0", "dependencies": {},
Also, swarmutil is not declared as dependency in SwarmCore package.json:
[~/workspace/SwarmCore] $ cat package.json |grep swarmutil [~/workspace/SwarmCore] $ npm install --save swarmutil swarmutil@1.1.0 node_modules/swarmutil sitapati@MacBook-Air [~/workspace/SwarmCore] $ node etc/tests/BenchmarkTest.js Error: connect ECONNREFUSED at exports._errnoException (util.js:746:11) at TCPConnectWrap.afterConnect as oncomplete
So I think: (1) add clone to swarmutil as dependency (2) add swarmutil to SwarmCore as dependency.
swarmutil is deprecated. It will reamain only for the swarm 1.0 projects Now the client and other things belonging to swarmutil are allready merged in SwarmCore. I still have to do some cleaning in tests to not depend on swarmutil.
OK, I uninstalled swarmutil, and I'll make a note whenever it complains.
fixed
[~/workspace/SwarmCore] $ node etc/tests/BenchmarkTest.js module.js:338 throw err; ^ Error: Cannot find module 'clone' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:278:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object. (/Users/sitapati/node_modules/swarmutil/lib/SwarmUtils.js:2:13)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
sitapati@MacBook-Air [~/workspace/SwarmCore] $ npm install clone
npm WARN package.json mocha@0.2.0 No repository field.
clone@1.0.2 node_modules/clone
sitapati@MacBook-Air [~/workspace/SwarmCore] $ node etc/tests/BenchmarkTest.js
module.js:338
throw err;
^
Error: Cannot find module 'clone'