Not able to successfully build polyfill-service
See original GitHub issueNot able to successfully build polyfill-service. Hi, The instructions mentioned in CONTRIBUTING.md was followed:
$ git clone https://github.com/Financial-Times/polyfill-service.git
$ cd polyfill-service
$ npm ci
$ npm run build # build the assets for the website
$ npm start # start a server on localhost:8080
But whenever I am building the application and executing the second last step i.e. “npm run build” I am getting error. The npm log is attached below:
/opt/polyfill-service# npm run build
polyfill-service@4.28.1 build /opt/polyfill-service run-s clean eleventy build:*
polyfill-service@4.28.1 clean /opt/polyfill-service rimraf ./dist ./.cache
polyfill-service@4.28.1 eleventy /opt/polyfill-service eleventy
Problem writing Eleventy templates: (more in DEBUG output)
Having trouble rendering 11ty.js template ./src/assets/v3/library.11ty.js
TemplateContentRenderError
was thrown
ENOENT: no such file or directory, open ‘/opt/polyfill-service/node_modules/polyfill-library-3.27.4/polyfills/__dist/aliases.json’
Error
was thrown:
Error: ENOENT: no such file or directory, open ‘/opt/polyfill-service/node_modules/polyfill-library-3.27.4/polyfills/__dist/aliases.json’
Benchmark (Data): ./src/data/polyfills.js
took 575ms (51.9%)
Using pathPrefix: /v3
Copied 9 files / Wrote 0 files in 0.91 seconds (v0.11.0)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! polyfill-service@4.28.1 eleventy: eleventy
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the polyfill-service@4.28.1 eleventy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-07-14T17_39_41_666Z-debug.log
ERROR: “eleventy” exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! polyfill-service@4.28.1 build: run-s clean eleventy build:*
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the polyfill-service@4.28.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-07-14T17_39_41_701Z-debug.log
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top GitHub Comments
I can confirm that if you were running as root,
npm set unsafe-perm true
resolves the issue:@aniket-gangadharan Are you running
npm ci
as the root user? If so npm will not run postinstall scripts unless you setunsafe-perm
to true like so –npm set unsafe-perm true
.