What does npm ERR! code ELSPROBLEMS mean?

Viewed 5049

Building a node project, using serverless

Firstly I get the error

Error:
Error: npm ls -prod -json -depth=1 failed with code 1
  at ChildProcess.<anonymous> (/Users/jrobens/NetBeansProjects/azuron/winpay/winpay- 

uploader/node_modules/serverless-webpack/lib/utils.js:91:16)

To find our more information I enter npm ls -prod -json -depth=1 and get

npm ERR! code ELSPROBLEMS
npm ERR! invalid: serverless@3.2.1 
/my-project/node_modules/serverless
{

It looks as though webpack worked

webpack compiled successfully in 4581 ms

About the environment: node-14, typescript, aws

├── @serverless/typescript@3.2.0
├── @types/serverless@3.0.0
├── serverless-apigw-binary@0.4.4
├── serverless-certificate-creator@1.6.0
├── serverless-dynamodb-local@0.2.40
├── serverless-http@2.7.0
├── serverless-iam-roles-per-function@3.2.0
├── serverless-plugin-aws-alerts@1.7.4
├── serverless-prune-plugin@2.0.1
├── serverless-s3-local@0.6.21
├── serverless-webpack@5.6.1
3 Answers

Fixing this

npm ls -prod json 

produces a json list of the packages. The -depth=1 flag brought an error to light. There was an invalid package.

Find the invalid package by

npm ls

and fix any error messages.

In my case there was an old serverless plugin that had a dependency of a different version of serverless.

I got the same error then updated angular and that solved it.

$ ng update

I fixed removing packages-lock.json and then doing npm install. Not sure if this is the best way to fix it, but it worked for me.

Related