简体   繁体   English

通过github安装的npm软件包-软件包无法解析,角度为4 / webpack

[英]npm package installed via github - package can't be resolved, angular 4 / webpack

I've had to fork a package to fix a couple of issues it had and while npm install seems to complete and the package ends up in node_modules 我不得不分叉一个软件包来修复它遇到的一些问题,而npm安装似乎已经完成,并且该软件包最终出现在node_modules中

在此处输入图片说明

I get build errors (could not resolve package) and red sqigglies in my typescript files: 我的打字稿文件中出现构建错误(无法解析程序包)和红色字样:

在此处输入图片说明

I installed it like this: 我这样安装它:

npm install mjharper84/adal-angular4 --save

from

https://github.com/mjharper84/adal-angular4

My package json looks like: 我的包json看起来像:

  "adal-angular4": "github:mjharper84/adal-angular4"

I have heard some prepublish script may need to run to build the package properly but I'm not sure how to implement it and can't find any examples. 我听说可能需要运行一些预发布脚本才能正确构建该程序包,但是我不确定如何实现它,并且找不到任何示例。 Any help appreciated 任何帮助表示赞赏

您的mjharper84/adal-angular4 package.json主脚本错误,请将其更改为: "main": "dist/index.js"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM