我正在努力为ng2-pop-over套餐制作PR。首先,我想通过将console.log放入ngOnInit
来进行一个简单的测试,看看我是否正在以正确的方式在本地构建和npm link
包,所以我:
npm i
npm run build
并得到了一堆警告,如下所示。
⚠️ '@angular/common' is imported by dist/index.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ '@angular/core' is imported by dist/pop-over.component.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'rxjs/Rx' is imported by dist/pop-over.component.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ '@angular/core' is imported by dist/pop-over-trigger.directive.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ 'rxjs' is imported by dist/pop-over-trigger.directive.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ '@angular/core' is imported by dist/index.js, but could not be resolved – treating it as an external dependency
https://github.com/rollup/rollup/wiki/Troubleshooting#treating-module-as-external-dependency
⚠️ No name was provided for external module 'rxjs/Rx' in options.globals – guessing 'rxjs_Rx'
⚠️ No name was provided for external module 'rxjs' in options.globals – guessing 'rxjs'
npm link
npm link ng2-pop-over
编译失败。
./~/ng2-pop-over/index.js
Module build failed: Error: ENOENT: no such file or directory, open '/Users/user1/Code/PopoverTest/node_modules/ng2-pop-over/index.js'
at Error (native)
@ ./src/app/app.module.ts 22:0-45
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
我做错了什么?