Shields: Unable to run Shields at Zeit Now

Created on 4 Nov 2018  Â·  2Comments  Â·  Source: badges/shields

Are you experiencing an issue with...

  • [ ] [shields.io](https://shields.io/#/)
  • [x] My own instance
  • [ ] [gh-badges NPM package](https://www.npmjs.com/package/gh-badges)

:beetle: Description
When I try to deploy Shields (master, d55e1c15a6e2c5de737129f20ef0c41e622cce1f) at Now (https://github.com/badges/shields/blob/master/doc/self-hosting.md#zeit-now) I get an error:


logs

➜  shields-platan git:(master) ✗ npm i && npm run build

> [email protected] install /home/m/workspaces/github/shields-platan/node_modules/husky
> node husky install

husky > setting up git hooks
husky > done

> [email protected] postinstall /home/m/workspaces/github/shields-platan/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> [email protected] postinstall /home/m/workspaces/github/shields-platan/node_modules/fast-xml-parser
> node tasks/postinstall.js

              Donating to an open source project is more affordable

                  *** Thank you for using fast-xml-parser! ***

                 Please consider donating to our open collective
                      to help us maintain this package.

                https://opencollective.com/fast-xml-parser/donate
                                      or
                   https://www.patreon.com/bePatron?u=9531404
                                      or
   https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KQJAX48SPUKNC

                                     ***



> [email protected] postinstall /home/m/workspaces/github/shields-platan/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js


> [email protected] postinstall /home/m/workspaces/github/shields-platan
> npm run depcheck


> [email protected] depcheck /home/m/workspaces/github/shields-platan
> check-node-version --node ">= 8.0"

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1734 packages from 1683 contributors and audited 10442 packages in 21.64s
found 10 vulnerabilities (8 low, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details

> [email protected] prebuild /home/m/workspaces/github/shields-platan
> npm run depcheck


> [email protected] depcheck /home/m/workspaces/github/shields-platan
> check-node-version --node ">= 8.0"


> [email protected] build /home/m/workspaces/github/shields-platan
> npm run examples && npm run features && next build && next export -o build/


> [email protected] examples /home/m/workspaces/github/shields-platan
> node lib/export-badge-examples-cli.js > badge-examples.json

No secret data found at /home/m/workspaces/github/shields-platan/private/secret.json (see lib/server-secrets.js)

> [email protected] features /home/m/workspaces/github/shields-platan
> node lib/export-supported-features-cli.js > supported-features.json

> Using external babel configuration
> Location: "/home/m/workspaces/github/shields-platan/package.json"
> using build directory: /home/m/workspaces/github/shields-platan/.next
  copying "static" directory
  copying "static build" directory
> exporting path: /

➜  shields-platan git:(master) ✗ now -n shields-prometheus-test -e METRICS_PROMETHEUS_ENABLED=true -e METRICS_PROMETHEUS_ALLOWED_IPS=".*"
> Deploying ~/workspaces/github/shields-platan under platan
> Your deployment's code and logs will be publicly accessible because you are subscribed to the OSS plan.

> NOTE: You can use `now --public` or upgrade your plan (https://zeit.co/account/plan) to skip this prompt
> Synced 4 files (43.52KB) [2s]
> Using Node.js 8.11.3 (requested: `8.x`)
> https://shields-prometheus-test-garvojltky.now.sh [in clipboard] (bru1) [9s]
> Building…
> â–² yarn
> yarn install v1.9.4
> info No lockfile found.
> [1/5] Validating package.json...
> [2/5] Resolving packages...
> warning jsonpath > jison > [email protected]: Package no longer supported. Contact [email protected] for more info.
> warning jsonpath > jison > jison-lex > [email protected]: Package no longer supported. Contact [email protected] for more info.
> warning eslint > file-entry-cache > flat-cache > [email protected]: CircularJSON is in maintenance only, flatted is its successor.
> warning sinon > nise > [email protected]: no longer maintained
> [3/5] Fetching packages...
> info [email protected]: The platform "linux" is incompatible with this module.
> info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
> [4/5] Linking dependencies...
> warning " > [email protected]" has incorrect peer dependency "sinon@>=4.0.0 <7.0.0".
> [5/5] Building fresh packages...
> success Saved lockfile.
> $ npm run depcheck
> 
> [email protected] prebuild /home/nowuser/src
> npm run depcheck
> 
> 
> [email protected] depcheck /home/nowuser/src
> check-node-version --node ">= 8.0"
> 
> 
> [email protected] build /home/nowuser/src
> npm run examples && npm run features && next build && next export -o build/
> 
> 
> [email protected] examples /home/nowuser/src
> node lib/export-badge-examples-cli.js > badge-examples.json
> 
> No secret data found at /home/nowuser/src/private/secret.json (see lib/server-secrets.js)
> 
> [email protected] features /home/nowuser/src
> node lib/export-supported-features-cli.js > supported-features.json
> 
> Using external babel configuration
> Location: "/home/nowuser/src/package.json"
> Failed to build
> { Error: (client) ./pages/index.js
> Module build failed: Error: [BABEL] /home/nowuser/src/pages/index.js: You gave us a visitor for the node type PrivateName but it's not a valid type
>     at verify (/home/nowuser/src/node_modules/next/node_modules/@babel/traverse/lib/visitors.js:143:13)
>     at Function.explode (/home/nowuser/src/node_modules/next/node_modules/@babel/traverse/lib/visitors.js:46:3)
>     at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:210:40
>     at cachedFunction (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/caching.js:40:17)
>     at loadPluginDescriptor (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:198:10)
>     at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:54:16
>     at Array.map (<anonymous>)
>     at recurseDescriptors (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:53:36)
>     at loadFullConfig (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:103:6)
>     at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/transform.js:26:33
>     at _combinedTickCallback (internal/process/next_tick.js:131:7)
>     at process._tickCallback (internal/process/next_tick.js:180:9)
>  @ multi ./pages/index.js
>     at /home/nowuser/src/node_modules/next/dist/build/index.js:144:31
>     at runWithDependencies (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:154:4)
>     at /home/nowuser/src/node_modules/async/dist/async.js:1140:9
>     at /home/nowuser/src/node_modules/async/dist/async.js:473:16
>     at iteratorCallback (/home/nowuser/src/node_modules/async/dist/async.js:1064:13)
>     at /home/nowuser/src/node_modules/async/dist/async.js:969:16
>     at /home/nowuser/src/node_modules/async/dist/async.js:1137:13
>     at runCompilers (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:96:47)
>     at fn (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:101:6)
>     at compiler.run (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:150:5)
>     at emitRecords.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:265:13)
>     at Compiler.emitRecords (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:371:38)
>     at emitAssets.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:258:10)
>     at applyPluginsAsyncSeries1.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:364:12)
>     at next (/home/nowuser/src/node_modules/tapable/lib/Tapable.js:218:11)
>     at Compiler.compiler.plugin (/home/nowuser/src/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
>   errors: 
>    [ '(client) ./pages/index.js\nModule build failed: Error: [BABEL] /home/nowuser/src/pages/index.js: You gave us a visitor for the node type PrivateName but it\'s not a valid type\n    at verify (/home/nowuser/src/node_modules/next/node_modules/@babel/traverse/lib/visitors.js:143:13)\n    at Function.explode (/home/nowuser/src/node_modules/next/node_modules/@babel/traverse/lib/visitors.js:46:3)\n    at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:210:40\n    at cachedFunction (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/caching.js:40:17)\n    at loadPluginDescriptor (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:198:10)\n    at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:54:16\n    at Array.map (<anonymous>)\n    at recurseDescriptors (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:53:36)\n    at loadFullConfig (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:103:6)\n    at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/transform.js:26:33\n    at _combinedTickCallback (internal/process/next_tick.js:131:7)\n    at process._tickCallback (internal/process/next_tick.js:180:9)\n @ multi ./pages/index.js',
>      '(server) ./pages/index.js\nModule build failed: Error: [BABEL] /home/nowuser/src/pages/index.js: You gave us a visitor for the node type PrivateName but it\'s not a valid type\n    at verify (/home/nowuser/src/node_modules/next/node_modules/@babel/traverse/lib/visitors.js:143:13)\n    at Function.explode (/home/nowuser/src/node_modules/next/node_modules/@babel/traverse/lib/visitors.js:46:3)\n    at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:210:40\n    at cachedFunction (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/caching.js:40:17)\n    at loadPluginDescriptor (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:198:10)\n    at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:54:16\n    at Array.map (<anonymous>)\n    at recurseDescriptors (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:53:36)\n    at loadFullConfig (/home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/config/full.js:103:6)\n    at /home/nowuser/src/node_modules/next/node_modules/@babel/core/lib/transform.js:26:33\n    at _combinedTickCallback (internal/process/next_tick.js:131:7)\n    at process._tickCallback (internal/process/next_tick.js:180:9)\n @ multi ./pages/index.js' ],
>   warnings: [] }
> npm ERR! code ELIFECYCLE
> npm ERR! errno 1
> npm ERR! [email protected] build: `npm run examples && npm run features && next build && next export -o build/`
> npm ERR! Exit status 1
> npm ERR! 
> npm ERR! Failed at the [email protected] 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!     /home/nowuser/.npm/_logs/2018-11-04T08_16_07_414Z-debug.log
> Error! Build failed

In logs there is a info that Now is using yarn to install dependencies (yarn install v1.9.4).
When I try to build Shields with yarn + npm (yarn install && npm run build) I get the same result. Before this commit there was no problem https://github.com/badges/shields/commit/730dc67cdfddec28868886d61d297ebcebc4e41a.

self-hosting

Most helpful comment

Is it possible this is related to messages like these I've been seeing posted to some of my commits?

Now could not deploy this pull request since the "files" configuration in now.json lists these files or directories which do not exist:

  • build/

These paths may be missing from the GitHub repository because of a .gitignore file.
Consider committing them to GitHub or removing them from the "files" list and generating the paths on Now instead using a build script for a Node.js deployment, or within your Dockerfile for a docker deployment.

For more information on the "files" configuration in now.json, visit https://zeit.co/docs/features/configuration#files(array)

This is from our now.json:

  "files": [
    "server.js",
    "favicon.png",
    "next.config.js",
    "build/",
    "frontend/",
    "lib/",
    "logo/",
    "pages/",
    "public/",
    "static/",
    "templates/",
    "services/"
  ],

This documentation makes me think we need to include package-lock.json in the list.

All 2 comments

Is it possible this is related to messages like these I've been seeing posted to some of my commits?

Now could not deploy this pull request since the "files" configuration in now.json lists these files or directories which do not exist:

  • build/

These paths may be missing from the GitHub repository because of a .gitignore file.
Consider committing them to GitHub or removing them from the "files" list and generating the paths on Now instead using a build script for a Node.js deployment, or within your Dockerfile for a docker deployment.

For more information on the "files" configuration in now.json, visit https://zeit.co/docs/features/configuration#files(array)

This is from our now.json:

  "files": [
    "server.js",
    "favicon.png",
    "next.config.js",
    "build/",
    "frontend/",
    "lib/",
    "logo/",
    "pages/",
    "public/",
    "static/",
    "templates/",
    "services/"
  ],

This documentation makes me think we need to include package-lock.json in the list.

@paulmelnikow package-lock.json done the job! :-) We can see in logs that NPM is used to install dependencies (npm install)

logs

➜  shields-platan git:(zow-package-lock) ✗ now -n shields-prometheus-test -e METRICS_PROMETHEUS_ENABLED=true -e METRICS_PROMETHEUS_ALLOWED_IPS=".*"
> Deploying ~/workspaces/github/shields-platan under platan
> Your deployment's code and logs will be publicly accessible because you are subscribed to the OSS plan.

> NOTE: You can use `now --public` or upgrade your plan (https://zeit.co/account/plan) to skip this prompt
> Synced 3 files (578.48KB) [7s]
> Using Node.js 8.11.3 (requested: `8.x`)
> https://shields-prometheus-test-sijbgwyxts.now.sh [in clipboard] (bru1) [9s]
> Building…
> â–² npm install
> 
> [email protected] install /home/nowuser/src/node_modules/husky
> node husky install
> 
> husky > setting up git hooks
> Can't find .git, skipping Git hooks installation.
> Please check that you're in a cloned repository or run 'git init' to create an empty Git repository and reinstall husky.
> 
> [email protected] postinstall /home/nowuser/src/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js
> 
> 
> [email protected] postinstall /home/nowuser/src/node_modules/fast-xml-parser
> node tasks/postinstall.js
> 
>               Donating to an open source project is more affordable
> 
>                   *** Thank you for using fast-xml-parser! ***
> 
>                  Please consider donating to our open collective
>                       to help us maintain this package.
> 
>                 https://opencollective.com/fast-xml-parser/donate
>                                       or
>                    https://www.patreon.com/bePatron?u=9531404
>                                       or
>    https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KQJAX48SPUKNC
> 
>                                      ***
> 
> 
> 
> [email protected] postinstall /home/nowuser/src/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js
> 
> 
> [email protected] postinstall /home/nowuser/src
> npm run depcheck
> 
> 
> [email protected] depcheck /home/nowuser/src
> check-node-version --node ">= 8.0"
> 
> npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
> npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
> 
> added 1744 packages in 39.675s
> â–² npm run build
> 
> [email protected] prebuild /home/nowuser/src
> npm run depcheck
> 
> 
> [email protected] depcheck /home/nowuser/src
> check-node-version --node ">= 8.0"
> 
> 
> [email protected] build /home/nowuser/src
> npm run examples && npm run features && next build && next export -o build/
> 
> 
> [email protected] examples /home/nowuser/src
> node lib/export-badge-examples-cli.js > badge-examples.json
> 
> No secret data found at /home/nowuser/src/private/secret.json (see lib/server-secrets.js)
> 
> [email protected] features /home/nowuser/src
> node lib/export-supported-features-cli.js > supported-features.json
> 
> Using external babel configuration
> Location: "/home/nowuser/src/package.json"
> using build directory: /home/nowuser/src/.next
>   copying "static" directory
>   copying "static build" directory
> exporting path: /
> 
> â–² Snapshotting deployment
> â–² Saving deployment image (47.2M)
> Build completed
> Verifying instantiation in bru1
> [0] 
> [0] [email protected] now-start /home/nowuser/src
> [0] node server
> [0] 
> [0] 1104193553 FsTokenPersistence configured with /tmp/persistence/github-user-tokens.json
> [0] Metrics are enabled. Access to /metrics resoure is limited to IP addresses matching: /.*/
> [0] 1104193553 Server is starting up: http://[::]:80/
> [0] No fallback font set.
> [0] Unable to load fallback font. Using Helvetica-Bold instead.
> ✔ Scaled 1 instance in bru1 [47s]
> Success! Deployment ready

I will a PR in a moment.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fazendaaa picture Fazendaaa  Â·  3Comments

irgolic picture irgolic  Â·  3Comments

bruno-garcia picture bruno-garcia  Â·  3Comments

salaros picture salaros  Â·  3Comments

stclairdaniel picture stclairdaniel  Â·  3Comments