0
我试图在节点中与d3一起玩(并成功地做了早些时候?)。所以我做了在节点REPL中使用第三方包
npm install -g d3
这很好。让我们来看看:
$ npm list -g d3
/usr/local/lib
└── [email protected]
很好。让我们确保我拥有正确的包装:
$ grep name /usr/local/lib/node_modules/d3/package.json
"name": "d3",
很好。所以尽量要求其:
$ node
var d3 = require('d3');
Error: Cannot find module 'd3'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at repl:1:10
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
都能跟得上!是什么赋予了?
好的,所以第一次发生的事情是我在当地完成的,然后才按照我想要的方式在全球范围内完成,然后它“神奇地”工作。 – djechlin 2014-11-15 00:19:10