【发布时间】:2014-11-15 00:06:53
【问题描述】:
我正在尝试在 node.所以我做到了
npm install -g d3
效果很好。让我们检查一下:
$ npm list -g d3
/usr/local/lib
└── d3@3.4.13
太棒了。让我们确保我的包裹是正确的:
$ 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)
不!什么给了?
【问题讨论】:
标签: node.js require read-eval-print-loop