1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
Hello,
The problem is caused by the change in npm version; there was a breaking change between npm v6 (Node.js 14) and npm v8 (Node.js 16) relating to filesystem permissions.
Solution:
- Create the following Platform Hooks paths in the root directory of your application bundle.
- .platform/hooks/prebuild
- .platform/confighooks/prebuild
- Create the following bash script (00_npm_install.sh) with execute permissions (chmod +x).
#!/bin/bash cd /var/app/staging sudo -u webapp npm install sharp
- Validate the Application Bundle Structure.
Example Sample project structure:
~/my-app/
├── app.js
├── index.html
├── .npmrc_bkp
├── package.json
├── package-lock.json
├── .platform
│ ├── confighooks
│ │ └── prebuild
│ │ └── 00_npm_install.sh
│ └── hooks
│ └── prebuild
│ └── 00_npm_install.sh
└── Procfile
- Deploy the Application!
This solution is explained in more details on this post https://github.com/lovell/sharp/issues/3221#issuecomment-1126528844
관련 콘텐츠
- AWS 공식업데이트됨 2년 전