npm errors blocked my workflow

Hi, I am working on an open source project Oppia, and these npm errors blocked my workflow.

More details see: https://github.com/oppia/oppia/issues/6914

What could be the cause of these errors? Thank you!

Down at the bottom of start.sh there is a call to npm list:

NPM_INSTALLED_MODULES="$($NPM_CMD list)"

If you call npm list in a package in which you have not yet done an npm install, the list command generates those errors. A simplistic work-around in the script might be to test for the presence of node_modules folder before attempting to generate the package list?

Example instructions to show error:

# new folder
$ npm init -y
$ npm install commander
$ npm list
8213@1.0.0 /Users/john/Documents/Sandpits/npm.community/8213
└── commander@2.20.0
$ rm -rf node_modules
$ npm list
8213@1.0.0 /Users/john/Documents/Sandpits/npm.community/8213
└── UNMET DEPENDENCY commander@2.20.0

npm ERR! missing: commander@2.20.0, required by 8213@1.0.0

Hi John,

Thank you for your quick response and it helped us solve the issue!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.