Int*_*ted 18 node.js npm serverless
使用无服务器构建节点项目
\n首先我得到错误
\nError:\nError: npm ls -prod -json -depth=1 failed with code 1\n at ChildProcess.<anonymous> (/Users/jrobens/NetBeansProjects/azuron/winpay/winpay- \nRun Code Online (Sandbox Code Playgroud)\n上传者/node_modules/serverless-webpack/lib/utils.js:91:16)
\n要查找更多信息,我输入npm ls -prod -json -depth=1并获取
\nnpm ERR! code ELSPROBLEMS\nnpm ERR! invalid: serverless@3.2.1 \n/my-project/node_modules/serverless\n{\nRun Code Online (Sandbox Code Playgroud)\n看起来 webpack 已经工作了
\nwebpack compiled successfully in 4581 ms\nRun Code Online (Sandbox Code Playgroud)\n关于环境:node-14、typescript、aws
\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 @serverless/typescript@3.2.0\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 @types/serverless@3.0.0\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-apigw-binary@0.4.4\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-certificate-creator@1.6.0\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-dynamodb-local@0.2.40\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-http@2.7.0\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-iam-roles-per-function@3.2.0\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-plugin-aws-alerts@1.7.4\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-prune-plugin@2.0.1\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-s3-local@0.6.21\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 serverless-webpack@5.6.1\nRun Code Online (Sandbox Code Playgroud)\n
Int*_*ted 11
解决这个问题
npm ls -prod json
Run Code Online (Sandbox Code Playgroud)
生成包的 json 列表。-depth=1 标志暴露了一个错误。有一个无效的包。
通过以下方式查找无效包
npm ls
Run Code Online (Sandbox Code Playgroud)
并修复任何错误消息。
就我而言,有一个旧的无服务器插件,它依赖于不同版本的无服务器。
| 归档时间: |
|
| 查看次数: |
22393 次 |
| 最近记录: |