我正在通過構建我的第一個node.js應用程序,並使用mongodb後端工作。我沒有安裝任何框架(如mean.io),但我只是試圖一步一步建立,所以我明白每個組件的作用等等。如何將角度js添加到現有的node.js應用程序中?
到目前爲止,太棒了。我的節點js應用程序通過express顯示GET方法,並查詢我的mongdb。現在它只是拋出了一堆json數據。
現在,我想開始在GUI上工作。所以我一直在看angularjs。
[email protected]:/var/www/html/node/inventory$ sudo npm install angularjs
[email protected] /var/www/html/node/inventory
└── [email protected]
當我爲一直裝什麼清點檢查NPM,這是我所看到的:我已經使用這個命令安裝它(這只是一個局部的列表...讓我的問題/後短期和可讀性)
[email protected]:/var/www/html/node/inventory$ npm ls
[email protected] /var/www/html/node/inventory
├── [email protected] extraneous
├─┬ [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]
│ ├── [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]
npm ERR! extraneous: [email protected] /var/www/html/node/inventory/node_modules/angularjs
在閱讀其他職位,有些似乎表明它與用戶(例如,不使用根)安裝包做。 但這似乎並不是這裏的問題。
問題
我想一些幫助診斷這個錯誤我看到... 也曾經我有它正確安裝,什麼是對的角度融入我現有節點JS應用的最佳方式?我在網上看到的例子講述瞭如何初始化一個新的應用程序,但這不是我想要的。
謝謝!
可能重複[當本地安裝時出現無關的包](http://stackoverflow.com/questions/16252750/extraneous-package-when-installed-locally) –
角1需要一個DOM,它不存在於節點,但是Angular 2可能工作 –