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

Upgrade from 22.5.1 to 22.6.0 fails with error /bin/sh: 1: babel: not found #263

Closed
tmorehouse opened this issue May 22, 2019 · 11 comments · Fixed by #265
Closed

Upgrade from 22.5.1 to 22.6.0 fails with error /bin/sh: 1: babel: not found #263

tmorehouse opened this issue May 22, 2019 · 11 comments · Fixed by #265
Labels

Comments

@tmorehouse
Copy link

tmorehouse commented May 22, 2019

After upgrading to 22.6.0, we get the following build error when installing eslint-plugin-jest:

error /root/project/bootstrap-vue/node_modules/eslint-plugin-jest: Command failed.
Exit code: 1
Command: yarn build
Arguments: 
Directory: /root/project/bootstrap-vue/node_modules/eslint-plugin-jest
Output:
yarn run v1.13.0
$ babel --extensions .js,.ts src --out-dir lib
/bin/sh: 1: babel: not found
error Command failed with exit code 127.

Fails due to the postinstall command introduced via #257 which tries to compile files with babel.

@quarties
Copy link

I can confirm that issue - rolling back to version 22.5.1 can fix that.

@mdavis199
Copy link

I think the problem is because @babel/cli is listed as a devDependency; but babel is being used during the installation of eslint-plugin-jest when the post-install script is run. So, babel is no longer a devDependency; it's required for installation.

@swissspidy
Copy link

I am getting a similar issue, but in my case it's yarn that is not installed, not babel. So it fails earlier.

@shazron
Copy link

shazron commented May 22, 2019

This is the commit that introduced the build issue I believe: https://github.com/jest-community/eslint-plugin-jest/pull/257/commits
I don't have yarn installed globally, so it fails

@ranyitz
Copy link
Contributor

ranyitz commented May 22, 2019

Running build during pretest solves the issue while enabling transpilation before running the tests. This PR should do the trick -#265

@SimenB
Copy link
Member

SimenB commented May 22, 2019

🎉 This issue has been resolved in version 22.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@tmorehouse
Copy link
Author

tmorehouse commented May 22, 2019

@SimenB Seeing a new error now when we run lint on our own packages after upgrading to 22.6.1:

#!/bin/bash -eo pipefail
yarn lint
yarn run v1.13.0
$ eslint --ext .js,.md,.vue ./
Error: Cannot find module '@typescript-eslint/experimental-utils'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
    at Function.Module._load (internal/modules/cjs/loader.js:535:25)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/root/project/bootstrap-vue/node_modules/eslint-plugin-jest/lib/rules/tsUtils.js:10:26)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 1

@SimenB
Copy link
Member

SimenB commented May 22, 2019

Oops, it's a dev dep not a regular dep. Mind sending a PR? Workaround is to install it yourself. I'm stuck on mobile (albeit with internet), so not the easiest to fix myself

@SimenB
Copy link
Member

SimenB commented May 22, 2019

Should be fixed whenever CI publishes the next version

@SimenB
Copy link
Member

SimenB commented May 22, 2019

https://github.com/jest-community/eslint-plugin-jest/releases/tag/v22.6.2

Hopefully things work now! 🤞

@tmorehouse
Copy link
Author

tmorehouse commented May 22, 2019

@SimenB Nope :(

#!/bin/bash -eo pipefail
yarn lint
yarn run v1.13.0
$ eslint --ext .js,.md,.vue ./
Error: Cannot find module 'typescript'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:609:15)
    at Function.Module._load (internal/modules/cjs/loader.js:535:25)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/root/project/bootstrap-vue/node_modules/@typescript-eslint/typescript-estree/dist/parser.js:17:25)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 1

Looks like typescript also needs to be moved to dependencies

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

Successfully merging a pull request may close this issue.

7 participants