Nicht finden können Modul 'winston'

Schrieb ich ein kleines Modul, das verwendet winston anmelden Sachen.

Ich verwendet sudo npm install -g winston (es ist auf einer vm...also bin ich nicht allzu besorgt mit sudo, etc.

Log von npm:

winston@0.7.2 /usr/local/lib/node_modules/winston
├── cycle@1.0.2
├── stack-trace@0.0.7
├── eyes@0.1.8
├── colors@0.6.2
├── async@0.2.9
├── pkginfo@0.3.0
└── request@2.16.6 (forever-agent@0.2.0, aws-sign@0.2.0, tunnel-agent@0.2.0, oauth-sign@0.2.0, json-stringify-safe@3.0.0, cookie-jar@0.2.0, node-uuid@1.4.1, mime@1.2.11, qs@0.5.6, hawk@0.10.2, form-data@0.0.10)

Wenn ich versuche, um mein Modul in node, den ich bekommen:

Error: Cannot find module 'winston'
    at Function.Module._resolveFilename (module.js:331:15)
    at Function.Module._load (module.js:273:25)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Object.<anonymous> (/home/name/Code/neon/neon-js-spike/logger.js:2:9)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Module.require (module.js:357:17)

System-Versionen:
ubuntu
Knoten v = v0.11.7-pre
npm -v = 1.3.8

P. S. ich habe versucht, diese auf meinem Heim-laptop (ein anderes ubuntu vm) und arbeitete.

  • Sie konnte immer installieren winston lokal im gleichen Verzeichnis wie das Programm.
  • installieren Sie es lokal funktioniert, aber ich verstehe nicht, wie kommen Sie auf meine anderen vm-Installation weltweit gearbeitet. Vielen Dank für Ihre Hilfe.
InformationsquelleAutor hba | 2013-10-15
Schreibe einen Kommentar