Reputation: 5946
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: [email protected]
/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/[email protected]
├── @types/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
Upvotes: 23
Views: 34586
Reputation: 123490
In addition to the first answer, this problem seems to happen more often when installing packages from the local disk, ie npm ls /some/dir/somewhere
.
After I'd installed a package I was working on from the local disk:
[email protected] /home/mike/Code/portal/decentralized-ip/app
└─┬ @myorg/[email protected] -> ./../../some-dir
└─┬ ...
└─┬ ...
└─┬ @metaplex-foundation/[email protected]
└─┬ @bundlr-network/[email protected]
└─┬ [email protected]
└── [email protected] invalid: "https://github.com/Bundlr-Network/avsc#csp-fixes" from ../../svelte-on-solana-wallet-adapter/node_modules/arbundles
After publishing to npm, removing the locally installed version, then installing from npm, the problem is fixed:
[email protected] /home/mike/Code/portal/decentralized-ip/app
└─┬ @myorg/[email protected]
└─┬ ..
└─┬ ...
└─┬ @metaplex-foundation/[email protected]
└─┬ @bundlr-network/[email protected]
└─┬ [email protected]
└── [email protected] (git+ssh://[email protected]/Bundlr-Network/avsc.git#a730cc8018b79e114b6a3381bbb57760a24c6cef)
Upvotes: 1
Reputation: 387
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.
Upvotes: 5
Reputation: 1
I got the same error then updated angular and that solved it.
$ ng update
Upvotes: 0
Reputation: 5946
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.
Upvotes: 13