【发布时间】:2020-01-19 00:13:14
【问题描述】:
我正在我的应用程序中创建一个 Angular Element 'ele-counter'。我已经单独测试了组件,它工作正常。它构建成功。但是当我尝试运行包来创建“ele-counter.js”文件时,它会给出以下错误“无法执行包脚本” - 错误代码 ELIFECYCLE。我正在使用 JScat 来运行包。下面是我的代码
package.json
"build-element": "ng build ele-counter && ng build --prod --output-hashing none",
"package": "jscat ./dist/custom-counter/runtime.js ./dist/custom-counter/polyfills.js ./dist/custom-counter/scripts.js ./dist/custom-counter/main.js > ele-counter.js"
当我尝试运行以下命令时
npm run build-element && npm run package
第一个命令运行良好。但它失败了 - npm run package
以下来自日志文件
info lifecycle custom-counter@0.0.0~package: Failed to exec package script
verbose stack Error: custom-counter@0.0.0 package: `jscat ./dist/custom-counter/runtime.js ./dist/custom-counter/polyfills.js ./dist/custom-counter/scripts.js ./dist/custom-counter/main.js > ele-counter.js`
verbose stack Exit status 1
error code ELIFECYCLE
error errno 1
This is probably not a problem with npm. There is likely additional logging output above.
我已经尝试过缓存清理、更新 node_modules 等。无论我在谷歌上找到哪种解决方案。但没有任何效果。
谁能帮忙?
【问题讨论】:
标签: angular npm npm-scripts angular-elements