Can't resolve '@forge/resolver'

Hey guys,

I’m following this tutorial step by step: https://developer.atlassian.com/platform/forge/build-a-custom-ui-app-in-jira/

Upon getting to this part: https://developer.atlassian.com/platform/forge/build-a-custom-ui-app-in-jira/#build-the-content-for-your-custom-ui

forge deploy

package.json:

{
  "name": "forge-ui-starter",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "private": true,
  "devDependencies": {
    "eslint": "^7.32.0",
    "eslint-plugin-react-hooks": "^2.1.2"
  },
  "dependencies": {
    "@forge/resolver": "^1.3.5"
  }
}

Any ideas?

Best regards.

Hi @FelipeMedeirosB

Thanks for reaching out.

I was not able to reproduce your bug unfortunately.

Do you mind sharing which version of Node you are using? (mine was v12.19.0).

Cheers,
Xavier

Sure:

node --version

v17.3.0

Hi again,

I believe we have currently a bug in the CLI which makes it unusable with Node 17.

We recommend using LTS versions of Node (12, 14, 16) as those are officially supported Node versions.

See this previous post: Forge install always fails - #4 by kchan

Hope this helps and will fix your issue.

Cheers,
Xavier

Downgraded to v16.13.1 and I get the same error.

Could this be cause I’m on a M1 Mac?

I’ll try with a 14 version anyway, just to check

Hmm very strange.

Which version of the CLI are you using? (check with forge --version).

Mine was: 2.0.6 (the current @forge/cli@latest version)

forge --version
2.0.6

I was still not able to reproduce in Node 16 (deployment worked).

The only way I spotted something similar to your output is it I delete my node_modules folder.

What happens if you run npm i in your terminal?

And then try redeploying with forge deploy?

➜  cd-hello-world-custom-ui npm i 
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 

added 136 packages, and audited 137 packages in 5s

15 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
➜  cd-hello-world-custom-ui forge deploy
Deploying your app to the development environment.
Press Ctrl+C to cancel.

Running forge lint...
No issues found.

✔ Deploying your app to development...

ℹ Packaging app files
ℹ Uploading app
ℹ Validating manifest
ℹ Snapshotting functions
ℹ Deploying to environment

✔ Deployed

Deployed your app to the development environment.

It seems like it wroked I think the issue is this:

1. Navigate to the static/hello-world directory.
2. Install the needed dependencies:

npm install

  1. Build the assets:

npm run build

  1. Navigate back to the top-level directory of your app.

It tells you to navigate to that folder, but after running install in the root folder it worked.

Could that be it?

1 Like

Glad it got resolved!

When you create an app with forge create it will attempt to install the dependencies for you, but this might fail. In this case, you have to manually run npm i in your top level directory to install the packages :slight_smile:

Have a great weekend!

Cheers,
Xavier

2 Likes