2017-08-29 87 views
0

我在我的Angular4應用程序中使用xml2js時遇到問題。在angular4應用程序中導入xml2js

我通過NPM安裝了它,並將其導入這樣的:

import {parseString} from "xml2js"; 

但是,當我開始我的申請,我得到這個錯誤:

Failed to load resource: the server responded with a status of 404 (Not Found) 
Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/node_modules/xml2js 

我也安裝分型。

我新的角度(與打字稿),所以我會很高興,如果有人可以幫我解釋一下我做錯了什麼:)

回答

0

我導入的庫完全按照你創建一個乾淨的項目做使用角度cli,它導入並正常工作。

如果你是新手,我會推薦使用官方的cli工具來設置你的項目,它簡化了許多與導入包相關的事情。

https://cli.angular.io/

+0

謝謝,我會試試看 – Thessi

相關問題