build-image
build-image copied to clipboard
Latest NPM versions throw an error when workspaces are configured
Describe the bug
Versions of NPM greater than 8.4 throw an error if the build is using NPM workspaces. It seems like the reason is workspaces aren't compatible with npm set so we might need to rethink this command
To Reproduce
Steps to reproduce the behavior:
- Create a monorepo using npm workspaces.
- Deploy to Netlify.
- See the errors being logged.
Configuration
NPM_VERSION isn't set
Expected behavior
No error logs
Build Output
6:28:58 PM: npm workspaces detected
6:28:58 PM: Installing NPM modules using NPM version 8.11.0
6:28:59 PM: npm ERR! code ENOWORKSPACES
6:28:59 PM: npm ERR! This command does not support workspaces.
6:28:59 PM: npm ERR! A complete log of this run can be found in:
6:28:59 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-06-15T16_28_58_982Z-debug-0.log
Additional context
Add any other context about the problem here.
This one is tackled in https://github.com/netlify/build-image/pull/845 as npm set is outdated an not used anymore by npm as they are now using cacache