Unexpected npm Usage During Build Despite Using pnpm in Platform.sh

I am experiencing an issue with my build process on Platform.sh where npm is being used to install dependencies despite specifying pnpm in my configuration. This is causing dependency resolution errors. Below are the details of my platform.app.yaml file and the error message received.

name: auth-app
type: "nodejs:20"
# Specify the build and start commands
build:
	flavor: none
web:
	commands:
		start: pnpm run dev
dependencies:
	nodejs:
		pnpm: "*"
hooks:
	build: pnpm install
	deploy: |
		echo "Deploying auth-app"
# Optional: specify the disk size
disk: 2048
# Environment variables
variables:
	env:
		NODE_ENV: "production"
		PORT: "3000"


the error i got :
 

Building a NodeJS application, let's make it fly.
     Found a `package.json`, installing dependencies.
       W: npm notice
       W: npm notice New minor version of npm available! 10.7.0 -> 10.8.1
       W: npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
       W: npm notice To update run: npm install -g npm@10.8.1
       W: npm notice
       W: npm error code ERESOLVE
       W: npm error ERESOLVE unable to resolve dependency tree
       W: npm error
       W: npm error While resolving: @legitbee/auth-app@0.1.0
       W: npm error Found: react@18.2.0
       W: npm error node_modules/react
       W: npm error   react@"18.2.0" from the root project
       W: npm error   peer react@"^17.0.0 || ^18.0.0" from @mui/icons-material@5.15.20
       W: npm error   node_modules/@mui/icons-material
       W: npm error     @mui/icons-material@"^5.5.1" from the root project
       W: npm error   3 more (@mui/material, @emotion/react, @emotion/styled)
       W: npm error
       W: npm error Could not resolve dependency:
       W: npm error peer react@"^18.3.1" from react-dom@18.3.1
       W: npm error node_modules/react-dom
       W: npm error   react-dom@"^18.2.0" from the root project
       W: npm error   peer react-dom@"^17.0.0 || ^18.0.0" from @mui/material@5.15.20
       W: npm error   node_modules/@mui/material
       W: npm error     @mui/material@"^5.5.2" from the root project
       W: npm error     1 more (@mui/icons-material)
       W: npm error
       W: npm error Fix the upstream dependency conflict, or retry
       W: npm error this command with --force or --legacy-peer-deps
       W: npm error to accept an incorrect (and potentially broken) dependency resolution.
       W: npm error
       W: npm error
       W: npm error For a full report see:
 
     E: Error building project: `npm` could not be run.
   E: Error: Unable to build application, aborting.
 
0

Comments

2 comments
Date Votes
  • Hello! That is strange, as the inclusion of build.flavor: none should block that default npm install behavior in favor of what you have in your build hook. If you can share a project ID (feel free to open a support ticket as well where we can follow up) we can take a closer look at the activity.

    PS: Setting PORT will have no affect. All apps on Platform.sh run on port 8888, and PORT=8888 will be exposed automatically within the container no matter if you set it like you have here. 

    0
  • Hello,

    Thank you for your prompt response. I appreciate your assistance. I have double-checked the configuration, and I can confirm that I have build.flavor: none included in my platform.app.yaml. Despite this, npm is still being used during the build process instead of pnpm, which is causing dependency resolution errors.

    Here is the project ID for further investigation: fy56tgf7c3v4k.

    Please let me know if there is any additional information you need or any further steps I should take. I look forward to your assistance in resolving this issue.

    Thank you!

    Khaled

    0

Please sign in to leave a comment.

 

Didn't find what you were looking for?

New post