Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM workspaces not supported #120

Open
mickaeltr opened this issue May 28, 2024 · 0 comments
Open

NPM workspaces not supported #120

mickaeltr opened this issue May 28, 2024 · 0 comments

Comments

@mickaeltr
Copy link

Hello,

We have a mono-repository with multiple Node.js applications, using NPM packages: one package = one application

The structure is as follows:

/package.json → defines common dependencies
/node_modules → all dependencies will be downloaded here
/backend
/backend/package.json → backend dependencies only
/frontend
/frontend/package.json → frontend dependencies only

We have tried deploying a single workspace, by setting an NPM_CONFIG_WORKSPACE environment variable. The goal is to run all NPM commands with the option --workspace=$NPM_CONFIG_WORKSPACE, so that only the workspace dependencies are installed and cached.

However, if fails with the following error:

       Fetching source code
-----> Using buildpack 'nodejs'
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_WORKSPACE=frontend
       NODE_EXTRA_CA_CERTS=/usr/share/ca-certificates/Scalingo/scalingo-database.pem
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):   20
       engines.npm (package.json):    10
       
       Resolving node version 20...
       Downloading and installing node 20.13.1...
       Bootstrapping npm 10 (replacing 10.5.2)...
npm ERR! Workspaces not supported for global packages
npm ERR! A complete log of this run can be found in: /tmp/npmcache.aaJTU/_logs/2024-05-28T16_10_04_024Z-debug-0.log
       Unable to install npm 10.  Does npm 10 exist?  Is npm 10 compatible with this Node.js version?
-----> Build failed
grep: Unmatched ( or \(
       
       We're sorry this build is failing!
       
       If you're stuck, please send us an email so we can help:
       support@scalingo.com
       
       Keep coding,
       Scalingo
       
!     An error occurred during buildpack compilation
 !   Error deploying the application
 !   → Invalid return code from buildpack 

It would be very helpful to have support for NPM workspaces, so I am available to help if needed.

Thank you


Some documentation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant