문제

See this (javascript is the dir I am in):

➜  javascript  mkdir tmp
➜  javascript  cd tmp 
➜  tmp  mkdir node_modules
➜  tmp  node --version
v0.6.3
➜  tmp  npm --version
1.1.0-alpha-2
➜  tmp  npm install plates
plates@0.2.1 ./node_modules/plates 
➜  tmp  node
> p = require('plates')
{}
> p
{}
> p.bind
undefined
➜  tmp  npm uninstall plates
➜  tmp  sudo npm install plates -g 
Password:
plates@0.2.1 /usr/local/lib/node_modules/plates 
➜  tmp  node
> p = require('plates')
Error: Cannot find module 'plates'
    at Function._resolveFilename (module.js:334:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:357:17)
    at require (module.js:368:17)
    at repl:1:6
    at REPLServer.eval (repl.js:80:21)
    at Interface.<anonymous> (repl.js:182:12)
    at Interface.emit (events.js:67:17)
    at Interface._onLine (readline.js:162:10)
    at Interface._line (readline.js:426:8)

What am I missing here?

도움이 되었습니까?

해결책

Your problem isn't npm or node, you were doing it right. (btw, npm will create node_modules for you, and you definitely don't want to install it with -g).

This is an issue in plates. It looks like it was fixed in this commit:

https://github.com/flatiron/plates/commit/8934e2d4de88f951a28c6c1e555cd0bc6510a5ad

It looks like they bumped the version to 0.2.2, but it must not have been published to npm. I'll report an issue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top