2014-11-08 92 views
0

我正在嘗試使用yeoman腳手架的webapp。當我嘗試和節點進行任何操作時,我都會拋出錯誤。下面是我的命令行輸出,當我嘗試和'更新節點',當我嘗試和運行'喲webapp'。任何人都可以幫忙指出錯誤嗎?嘗試運行yeoman的節點錯誤

$ node update 

module.js:340 
    throw err; 
     ^
Error: Cannot find module  '/Users/william/wdi/pixelect_project/pixelect_client_server/update' 
    at Function.Module._resolveFilename (module.js:338:15) 
    at Function.Module._load (module.js:280:25) 
    at Function.Module.runMain (module.js:497:10) 
    at startup (node.js:119:16) 
    at node.js:906:3 


$ yo webapp 

module.js:340 
    throw err; 
     ^
Error: Cannot find module 'inquirer' 
    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 Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/insight/lib/index.js:9:16) 
    at Module._compile (module.js:456:26) 
    at Object.Module._extensions..js (module.js:474:10) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:312:12) 
    at Module.require (module.js:364:17) 

回答

2

我有同樣的問題。我的情況是這樣的:npm install -g yo

1

對我來說,其他節點應用程序也是如此(例如grunt和gulp)。 重新安裝它有訣竅。在這種情況下,您必須重新安裝generator-webapp(npm install -g generator-webapp)。如果重新安裝發電機後,您會得到與levon建議的一樣的信息,而不是重新安裝yeoman。