Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with opencollective in postinstall script on the heroku. #61

Closed
pro2s opened this issue Oct 16, 2020 · 4 comments
Closed

Error with opencollective in postinstall script on the heroku. #61

pro2s opened this issue Oct 16, 2020 · 4 comments

Comments

@pro2s
Copy link

pro2s commented Oct 16, 2020

Hi,

When I try to deploy my application a get an error (postinstall script in bootstrap-vue)

opencollective || exit 0
npm ERR! Cannot read property 'length' of undefined

engines.node (package.json): 12.18.2
engines.npm (package.json): 6.14.5

it seems that this is the reason that the heroku does not set process.argv and opencollective command crashes on this place:

.init(process.argv.length > 2 ? process.argv[2] : '.')

Is there any workaround?

@pi0
Copy link
Member

pi0 commented Oct 16, 2020

Hi @pro2s thanks for reporting issue. But just to ensure error is from bin, can you please share full stack trace or a screenshot of error in heroku?

@pro2s
Copy link
Author

pro2s commented Oct 16, 2020

Hi @pi0, It is definitely from postinstall, but unfortently I have not full debug log.
image

@pro2s
Copy link
Author

pro2s commented Oct 16, 2020

@pi0 there is full log:

       npm info lifecycle bootstrap-vue@2.17.3~install: bootstrap-vue@2.17.3
       npm info lifecycle bootstrap-vue@2.17.3~postinstall: bootstrap-vue@2.17.3
       
       > bootstrap-vue@2.17.3 postinstall /tmp/build_e8013a1b_/node_modules/bootstrap-vue
       > opencollective || exit 0
       
       npm verb lifecycle bootstrap-vue@2.17.3~postinstall: unsafe-perm in lifecycle true
       npm verb lifecycle bootstrap-vue@2.17.3~postinstall: PATH: /tmp/build_e8013a1b_/.heroku/node/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/tmp/build_e8013a1b_/node_modules/bootstrap-vue/node_modules/.bin:/tmp/build_e8013a1b_/node_modules/.bin:/tmp/build_e8013a1b_/.heroku/node/bin:/tmp/build_e8013a1b_/.heroku/yarn/bin:/app/.heroku/php/sbin:/app/.heroku/php/bin:/app/.heroku/php/sbin:/app/.heroku/php/bin:/app/.heroku/php/sbin:/app/.heroku/php/bin:/usr/local/bin:/usr/bin:/bin:/app/vendor/bin
       npm verb lifecycle bootstrap-vue@2.17.3~postinstall: CWD: /tmp/build_e8013a1b_/node_modules/bootstrap-vue
       npm info lifecycle axios@0.18.1~preinstall: axios@0.18.1
       npm info lifecycle is-buffer@2.0.4~preinstall: is-buffer@2.0.4
       npm info lifecycle is-buffer@2.0.4~install: is-buffer@2.0.4
       npm info lifecycle is-buffer@2.0.4~postinstall: is-buffer@2.0.4
       npm info lifecycle axios@0.18.1~install: axios@0.18.1
       npm info lifecycle axios@0.18.1~postinstall: axios@0.18.1
       npm info lifecycle undefined@undefined~install: undefined@undefined
       npm info lifecycle undefined@undefined~postinstall: undefined@undefined
       npm verb stack TypeError: Cannot read property 'length' of undefined
       npm verb stack     at _incorrectWorkingDirectory (/tmp/build_e8013a1b_/.heroku/node/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:114:60)
       npm verb stack     at /tmp/build_e8013a1b_/.heroku/node/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:86:44
       npm verb stack     at /tmp/build_e8013a1b_/.heroku/node/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:218:12
       npm verb stack     at callback (/tmp/build_e8013a1b_/.heroku/node/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:295:20)
       npm verb stack     at FSReqCallback.oncomplete (fs.js:168:5)
       npm verb cwd /tmp/build_e8013a1b_
       npm verb Linux 4.4.0-1078-aws
       npm verb argv "/tmp/build_e8013a1b_/.heroku/node/bin/node" "/tmp/build_e8013a1b_/.heroku/node/bin/npm" "ci" "--production=false" "--unsafe-perm" "--userconfig" "/tmp/build_e8013a1b_/.npmrc"
       npm verb node v12.18.2
       npm verb npm  v6.14.5
       npm ERR! Cannot read property 'length' of undefined
       npm verb exit [ 1, true ]

@pi0
Copy link
Member

pi0 commented Oct 16, 2020

Well then it makes sense:

npm ERR! Cannot read property 'length' of undefined

This error seems coming from:

   npm verb stack     at _incorrectWorkingDirectory (/tmp/build_e8013a1b_/.heroku/node/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:114:60)

Which is from a package without name and version fields (that's why there is undefined@undefined in the logs)

Here is also source to npm-lifecycle: https://github.com/npm/npm-lifecycle/blob/bfb6f73853a222a3f35a1a6651b0756816e2ed87/index.js#L114

There is also an open pull-request for fix: npm/npm-lifecycle#48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants