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

Can't ran any of the codemods #1105

Open
lcmen opened this issue Jan 24, 2021 · 8 comments
Open

Can't ran any of the codemods #1105

lcmen opened this issue Jan 24, 2021 · 8 comments

Comments

@lcmen
Copy link

lcmen commented Jan 24, 2021

Updating app to the latest Ember version (3.24.0) succeeded but running any of the codemods after that always fail:

Output from command with debug flag:

$ DEBUG=ember-cli-update,boilerplate-update,git-diff-apply ember update --run-codemods
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Running as an Ember addon is deprecated. Please run as a global install instead.
? Which blueprint would you like to run codemods for? ember-cli
? These codemods apply to your project. Select which ones to run. es5-getter-ember-codemod
Running codemod es5-getter-ember-codemod
Running command 1 of 1
  boilerplate-update npx github:rondale-sc/es5-getter-ember-codemod es5-getter-ember-codemod app/**/*.js tests/*.js tests/!(dummy)/**/*.js tests/dummy/app/**/*.js +0ms
  boilerplate-update npx github:rondale-sc/es5-getter-ember-codemod es5-getter-ember-codemod app/**/*.js tests/*.js tests/!(dummy)/**/*.js tests/dummy/app/**/*.js {
  preferLocal: true,
  stdio: [ 'pipe', 'pipe', 'inherit' ],
  cwd: '/home/lucas/Workspace/src/github.com/lowski/fapiao'
} +1ms
npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/lucas/.npm/_logs/2021-01-24T14_12_32_031Z-debug.log
Install for [ 'github:rondale-sc/es5-getter-ember-codemod' ] failed with code 1
Error running command github:rondale-sc/es5-getter-ember-codemod es5-getter-ember-codemod app/**/*.js tests/*.js tests/!(dummy)/**/*.js tests/dummy/app/**/*.js
Error: Command failed with exit code 1: npx github:rondale-sc/es5-getter-ember-codemod es5-getter-ember-codemod app/**/*.js tests/*.js tests/!(dummy)/**/*.js tests/dummy/app/**/*.js
    at makeError (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/boilerplate-update/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/boilerplate-update/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.runCodemod (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/boilerplate-update/src/run-codemod.js:21:9)
    at async runCodemods (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/boilerplate-update/src/run-codemods.js:7:5)
    at async promptAndRunCodemods (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/boilerplate-update/src/prompt-and-run-codemods.js:20:3)
    at async codemods (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/ember-cli-update/src/codemods.js:80:10)
    at async Class.run (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/ember-cli-update/src/command.js:99:16)
    at async /home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/ember-cli/lib/cli/cli.js:204:32
    at async CLI.run (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/ember-cli/lib/cli/cli.js:251:14)
    at async module.exports (/home/lucas/Workspace/src/github.com/lowski/fapiao/node_modules/ember-cli/lib/cli/index.js:145:12)
  boilerplate-update git add -A { cwd: '/home/lucas/Workspace/src/github.com/lowski/fapiao' } +1s
Cannot read property 'resolveConflictsProcess' of undefined


Stack Trace and Error Report: /tmp/error.dump.a7f40e3ebdb5556e6ac210592d1140eb.log

After quick research it looks like it might be an issue with isaacs/node-graceful-fs#192 but I'm not sure how to fix it.

@lcmen lcmen changed the title Can't ran any of the codemodes Can't ran any of the codemods Jan 24, 2021
@malatin3
Copy link

Also just upgraded. Same issue.

@maxwondercorn
Copy link
Contributor

maxwondercorn commented Mar 10, 2021

Same issue here

Update:

I went back and tried the upgrade again and had some success. This was an add-on upgrade from 3.12 -> 3.16. I'm not sure my steps fixed the issue but I wanted to document them

  • I realized that I'm running Node 14 and Ember 3.12 is Node 8/10, so I rolled back to Node 12 (not sure this did anything)
  • I ran the codemods before the upgrade to make sure there weren't problems before upgrading - all codemods selected, no issues
  • Ran the upgrade - no issues
  • Ran the codemods post upgrade - had some failures
    • ember-modules-codemod
    • ember-qunit-codemod
    • ember-test-helpers-codemod
    • es5-getter-ember-codemod

These codemods failed with the error: Cannot read property 'resolveConflictsProcess' of undefined. These would not run at all previously. These errors may be related to devDeps that weren't updated in the process or that this is an addon not an app.

I'll work on this some more and update again

3/10/21 Update to the update

From my last update, I didn't realize that I upgraded all the way to 3.25, not 3.16. When I reversed the update and then updated to 3.16 I could run the codemods without errors.

I still needed to be on Node 12.

@ballPointPenguin
Copy link

I'm seeing this same issue, I believe, when using node 12.x. When I revert to node 10.x it appears to be resolved.

@maxwondercorn
Copy link
Contributor

@ballPointPenguin are you using yarn or npm?

I’m using yarn and was seeing errors related to node-gyp errors related to node 14. Rolling back to 12 fixed those errors and I could use ember-cli-update. I’m planning to test against npm

@ballPointPenguin
Copy link

@maxwondercorn I'm using npm 6.
node 12 + npm 6 ☹️
node 10 + npm 6 😁

@AmilKey
Copy link

AmilKey commented Dec 13, 2021

Same issue, any updates on this issue?
node 12
npm 6
ember-cli: 3.28.4

@tavosansal
Copy link

Wondering if anyone has a fix for this? I have a smaller app I would like to update but cannot run codemods on it because of this issue.

@Yelinz
Copy link

Yelinz commented Oct 27, 2022

Look at this commit for node 12 and 14 versions which work 355af98

The file in question mentions version greater than 14.5 have a regression and will not work.
I had the same issue with cb.appply on 14.18/ 16.13, but downgrading to 14.4 allowed me to run the codemods.

# node 14.5 has a regression
# npm ERR! cb.apply is not a function
# - nodejs_version: "14"
- nodejs_version: "14.4"

This should be mentioned in the README or somewhere like that....

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

7 participants