aws-cloudformation / aws-cloudformation/cloudformation-cli-typescript-plugin

when trying to change the template to use nodejs20.x the build is failed

Ouverte
#121 9 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
46
Forks
18
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I am trying to create resource provider using Typescipt. I saw that the template is using node 14 - which is very old.
i have tried to use node 20. however cfn submit fail with error

command '['npm install --include=optional && sam build --debug --build-dir /Users/liraz/work/skywalker/server/netapp-cfn/export-policy/build --use-container TypeFunction']' returned non-zero exit status 1.

when running the npm install explicitly i am getting an error
`Error: NodejsNpmBuilder:NpmPack - NPM Failed: npm notice
npm notice New patch version of npm available! 10.2.3 -> 10.2.5
npm notice Changelog:
npm notice Run `npm install -g npm@10.2.5` to update!
npm notice
npm ERR! code 2
npm ERR! path /tmp/samcli/source
npm ERR! command failed
npm ERR! command sh -c npm run build
npm ERR! > netapp-fsx-svmpeer@0.1.0 build
npm ERR! > npx tsc
npm ERR!
npm ERR! error TS5033: Could not write file '/tmp/samcli/source/dist/handlers.js': EROFS: read-only file system, open '/tmp/samcli/source/dist/handlers.js'.
npm ERR! error TS5033: Could not write file '/tmp/samcli/source/dist/models.js': EROFS: read-only file system, open '/tmp/samcli/source/dist/models.js'.
npm ERR! npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm ERR! npm WARN config `--include=optional` to include them.
npm ERR! npm WARN config
npm ERR! npm WARN config Default value does install optional deps unless otherwise omitted.
npm ERR! npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm ERR! npm WARN config `--include=optional` to include them.
npm ERR! npm WARN config
npm ERR! npm WARN config Default value does install optional deps unless otherwise omitted.

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-12-07T21_50_45_696Z-debug-0.log
➜ cfnrp npm install --include=optional && sam build --debug --build-dir /Users/liraz/work/cfnrp/build --use-container TypeFunction
npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm WARN config `--include=optional` to include them.
npm WARN config
npm WARN config Default value does install optional deps unless otherwise omitted.
`

moving back to node14 and all is fine

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

L’issue indique le chemin de build TypeScript via npm run build, npx tsc et sam build pour TypeFunction ; commencez par reproduire le build Node.js 20 et inspecter le template ainsi que la configuration de build qui sélectionnent le runtime. C’est terminé lorsque le template Node.js 20 termine npm install et sam build sans les erreurs EROFS ou TS5033.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, nodejs, typescript
Domaine
build-system, cloud, devtools
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.