我寫了一個使用溫斯頓記錄的東西一點點模塊。找不到模塊「溫斯頓
我用sudo npm install -g winston
(它是在虛擬機上...所以我不是太在意使用sudo等從NPM
登錄:
[email protected] /usr/local/lib/node_modules/winston
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
當我嘗試運行我的模塊在節點獲得:
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)
系統版本:Ubuntu的 節點 -v = v0.11.7預 NPM -v = 1.3.8
附:我在我的家用筆記本電腦(另一個ubuntu vm)上試過這個,然後工作。
你總是可以安裝在本地溫斯頓,在同一目錄下的程序。 –
在本地安裝它工作,但我不明白如何在我的其他虛擬機安裝全球工作。謝謝你的幫助。 – hba