read package.json from the code : package.json.js

2019-09-18 18:05发布

问题:

I have an angular application but when I try this code :

require("../../../package.json").version

I get this error message :Error loading http://localhost/package.json.js as "../../../package.json" from app.component.js

why am i getting : package.json.js file? with such bizzare extension?

Thanks,