Homepage    |    GitHub    |    API    |    Wiki    |    FAQ

"Cannot find module '@joplin/renderer'" error while trying to build the code

Some details-
OS- Windows 10 Home
npm version- 8.1.4
node version - 14.18.1

I have tried looking for an error similar to mine in previous posts and in the internet but didn't find anything that would work. Any help would be greatly appreciated.


> postinstall
> npm run bootstrap --no-ci && npm run build


> bootstrap
> lerna bootstrap --force-local --no-ci

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Bootstrapping 16 packages
lerna info Installing external dependencies
lerna info Symlinking packages and binaries
lerna WARN EREPLACE_EXIST @joplin/lib is already installed for @joplin/plugin-repo-cli. Replacing with symlink...
lerna WARN EREPLACE_EXIST @joplin/tools is already installed for @joplin/plugin-repo-cli. Replacing with symlink...
info lifecycle @joplin/app-clipper@1.0.8~postinstall: @joplin/app-clipper@1.0.8s is already installed for @joplin/pl
info lifecycle @joplin/app-mobile@0.8.9~postinstall: @joplin/app-mobile@0.8.9
[                  ] | postinstall: verb lifecycle postinstall
> @joplin/app-mobile@0.8.9 postinstall C:\GSoc\Joplin\joplin\packages\app-mobile
> jetify && npm run build

Jetifier found 1513 file(s) to forward-jetify. Using 4 workers...
[                  ] | postinstall: verb lifecycle postinstall
> @joplin/app-mobile@0.8.9 build
> gulp build

[18:54:05] Using gulpfile C:\GSoc\Joplin\joplin\packages\app-mobile\gulpfile.js
[18:54:05] Starting 'build'...
[18:54:05] Starting 'buildInjectedJs'...
Building CodeMirror bundle...
Creating: C:\GSoc\Joplin\joplin/packages/app-mobile/lib/rnInjectedJs/webviewLib.js
Creating: C:\GSoc\Joplin\joplin/packages/app-mobile/lib/rnInjectedJs/CodeMirror.bundle.js
[18:54:35] Finished 'buildInjectedJs' after 30 sle postinstall
[18:54:35] Starting 'encodeAssets'...
[18:54:36] Finished 'encodeAssets' after 512 mscle postinstall
[18:54:36] Starting 'podInstall'...
[18:54:36] Finished 'podInstall' after 1.1 ms
[18:54:36] Finished 'build' after 31 s
[                  ] | postinstall: verb lifecycle postinstall
> @joplin/app-clipper@1.0.8 postinstall C:\GSoc\Joplin\joplin\packages\app-clipper
> cd popup && npm install

[                  ] | postinstall: verb lifecycle postinstall
> joplin-webclipper-popup@0.1.0 postinstall
> node postinstall.js && npm run build

[                  ] | postinstall: verb lifecycle postinstall
> joplin-webclipper-popup@0.1.0 build
> node scripts/build.js SKIP_PREFLIGHT_CHECK

Creating an optimized production build...lifecycle postinstall
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Compiled successfully. postinstall: verb lifecycle postinstall

File sizes after gzip:

  47.92 KB  build\static\js\2.chunk.jsrb lifecycle postinstall
  8.53 KB   build\static\js\main.chunk.js
  775 B     build\static\js\runtime-main.js
  771 B     build\static\css\main.chunk.css

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  bit.ly/CRA-deploy

[                  ] | postinstall: verb lifecycle postinstall
up to date, audited 1905 packages in 25s

68 packages are looking for funding
  run `npm fund` for details
[                  ] | postinstall: verb lifecycle postinstall
82 vulnerabilities (57 moderate, 22 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
info lifecycle @joplin/fork-htmlparser2@4.1.38~prepare: @joplin/fork-htmlparser2@4.1.38
info lifecycle @joplin/turndown-plugin-gfm@1.0.42~prepare: @joplin/turndown-plugin-gfm@1.0.42
info lifecycle @joplin/turndown@4.0.60~prepare: @joplin/turndown@4.0.60
[                ..] - prepare: verb lifecycle prepare
> @joplin/fork-htmlparser2@4.1.38 prepare C:\GSoc\Joplin\joplin\packages\fork-htmlparser2
> npm run build

[                ..] - prepare: verb lifecycle prepare
> @joplin/fork-htmlparser2@4.1.38 build
> tsc

[                ..] - prepare: verb lifecycle prepare
> @joplin/turndown-plugin-gfm@1.0.42 prepare C:\GSoc\Joplin\joplin\packages\turndown-plugin-gfm
> npm run build

[                  ] - prepare: verb lifecycle prepare
> @joplin/turndown-plugin-gfm@1.0.42 build
> rollup -c config/rollup.config.cjs.js

[                  ] - prepare: verb lifecycle prepare
src/gfm.js → lib/turndown-plugin-gfm.cjs.js...
created lib/turndown-plugin-gfm.cjs.js in 68ms prepare
[                  ] - prepare: verb lifecycle prepare
> @joplin/turndown@4.0.60 prepare C:\GSoc\Joplin\joplin\packages\turndown
> npm run build

[                  ] - prepare: verb lifecycle prepare
> @joplin/turndown@4.0.60 build
> rollup -c config/rollup.config.cjs.js

[                  ] - prepare: verb lifecycle prepare
src/turndown.js → lib/turndown.cjs.js...
created lib/turndown.cjs.js in 354ms lifecycle prepare
lerna success Bootstrapped 16 packages

> build
> lerna run build && npm run tsc

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 6 packages: "npm run build"
lerna info run Ran npm script 'build' in 'joplin' in 5.8s:

> joplin@2.6.1 build
> gulp build

[18:55:29] Using gulpfile C:\GSoc\Joplin\joplin\packages\app-cli\gulpfile.js
[18:55:29] Starting 'build'...
[18:55:29] Starting 'prepareBuild'...
[18:55:30] Finished 'prepareBuild' after 1.03 s
[18:55:30] Finished 'build' after 1.03 s
lerna info run Ran npm script 'build' in '@joplin/server' in 5.7s:

> @joplin/server@2.6.11 build
> gulp build

[18:55:29] Using gulpfile C:\GSoc\Joplin\joplin\packages\server\gulpfile.js
[18:55:29] Starting 'build'...
[18:55:29] Starting 'compilePackageInfo'...
Generated C:\GSoc\Joplin\joplin\packages\server/dist/packageInfo.js
[18:55:30] Finished 'compilePackageInfo' after 810 ms
[18:55:30] Finished 'build' after 841 ms
lerna info run Ran npm script 'build' in '@joplin/turndown-plugin-gfm' in 6.7s:

> @joplin/turndown-plugin-gfm@1.0.42 build
> rollup -c config/rollup.config.cjs.js

lerna info run Ran npm script 'build' in '@joplin/turndown' in 7.2s:

> @joplin/turndown@4.0.60 build
> rollup -c config/rollup.config.cjs.js

lerna info run Ran npm script 'build' in '@joplin/fork-htmlparser2' in 20.8s:

> @joplin/fork-htmlparser2@4.1.38 build
> tsc

lerna info run Ran npm script 'build' in '@joplin/app-mobile' in 30.0s:

> @joplin/app-mobile@0.8.9 build
> gulp build

[18:55:29] Using gulpfile C:\GSoc\Joplin\joplin\packages\app-mobile\gulpfile.js
[18:55:29] Starting 'build'...
[18:55:29] Starting 'buildInjectedJs'...
Building CodeMirror bundle...
Creating: C:\GSoc\Joplin\joplin/packages/app-mobile/lib/rnInjectedJs/webviewLib.js
Creating: C:\GSoc\Joplin\joplin/packages/app-mobile/lib/rnInjectedJs/CodeMirror.bundle.js
[18:55:54] Finished 'buildInjectedJs' after 25 s
[18:55:54] Starting 'encodeAssets'...
[18:55:54] Finished 'encodeAssets' after 348 ms
[18:55:54] Starting 'podInstall'...
[18:55:54] Finished 'podInstall' after 818 μs
[18:55:54] Finished 'build' after 25 s
lerna success run Ran npm script 'build' in 6 packages in 30.2s:
lerna success - joplin
lerna success - @joplin/app-mobile
lerna success - @joplin/fork-htmlparser2
lerna success - @joplin/server
lerna success - @joplin/turndown-plugin-gfm
lerna success - @joplin/turndown

> tsc
> lerna run tsc --stream --parallel

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 7 packages: "npm run tsc"
joplin: > joplin@2.6.1 tsc
joplin: > node node_modules/typescript/bin/tsc --project tsconfig.json
@joplin/app-mobile: > @joplin/app-mobile@0.8.9 tsc
@joplin/app-mobile: > node node_modules/typescript/bin/tsc --project tsconfig.json
@joplin/htmlpack: > @joplin/htmlpack@2.6.0 tsc
@joplin/htmlpack: > tsc --project tsconfig.json
@joplin/plugin-repo-cli: > @joplin/plugin-repo-cli@2.6.2 tsc
@joplin/plugin-repo-cli: > tsc --project tsconfig.json
@joplin/renderer: > @joplin/renderer@2.6.2 tsc
@joplin/renderer: > node node_modules/typescript/bin/tsc --project tsconfig.json
@joplin/server: > @joplin/server@2.6.11 tsc
@joplin/server: > tsc --project tsconfig.json
@joplin/tools: > @joplin/tools@2.6.2 tsc
@joplin/tools: > tsc --project tsconfig.json
@joplin/plugin-repo-cli: ../lib/markdownUtils.ts(1,31): error TS2307: Cannot find module '@joplin/renderer' or its corresponding type declarations.
@joplin/plugin-repo-cli: lib/errorsHaveChanged.test.ts(60,37): error TS2345: Argument of type 'boolean | { one: string; two: string; } | { one: string; two?: undefined; } | {}' is not assignable to parameter of type 'ImportErrors'.
@joplin/plugin-repo-cli:   Type 'boolean' is not assignable to type 'ImportErrors'.
lerna ERR! npm run tsc exited 2 in '@joplin/plugin-repo-cli'
lerna WARN complete Waiting for 4 child processes to exit. CTRL-C to exit immediately.
npm ERR! code 2
npm ERR! path C:\GSoc\Joplin\joplin
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npm run bootstrap --no-ci && npm run build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shikhar\AppData\Local\npm-cache\_logs\2021-11-24T13_26_17_781Z-debug.log```

Strange, I am not getting these lines. Try cleaning the project maybe.

What do you exactly mean by cleaning the project?

npm run clean

EDIT

Followed by npm ci

I tried 'npm ci' but it would always hang after a step for a long time. I tried waiting for an hour but still no progress. So I terminated the process and tried 'npm install' and got the following error :-

> postinstall
> npm run bootstrap --no-ci && npm run build


> bootstrap
> lerna bootstrap --force-local --no-ci

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Bootstrapping 16 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 1 in '@joplin/app-mobile'
lerna ERR! npm install stderr:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @joplin/app-mobile@0.8.9
npm ERR! Found: react-native@0.66.1
npm ERR! node_modules/react-native
npm ERR!   react-native@"0.66.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@">=0.60 <0.64" from react-native-webview@10.10.2
npm ERR! node_modules/react-native-webview
npm ERR!   react-native-webview@"^10.9.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Shikhar\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shikhar\AppData\Local\npm-cache\_logs\2021-11-25T06_28_55_795Z-debug.log

lerna ERR! npm install exited 1 in '@joplin/app-mobile'
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.
npm ERR! code 1
npm ERR! path C:\GSoc\Joplin\joplin
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npm run bootstrap --no-ci && npm run build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shikhar\AppData\Local\npm-cache\_logs\2021-11-25T06_28_56_042Z-debug.log```

Not sure what is going on with your project. I'd try wiping all node_modules folders and running npm install again.

I deleted all the node_modules folders and did a few other changes to resolve some other errors so now I am getting a different error :-


> postinstall
> npm run bootstrap --no-ci && npm run build


> bootstrap
> lerna bootstrap --force-local --no-ci

lerna notice cli v3.22.1
lerna info versioning independent
lerna info Bootstrapping 16 packages
lerna info Installing external dependencies
lerna info Symlinking packages and binaries
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/renderer dependency of joplin, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/tools dependency of joplin, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/lib dependency of joplin, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/tools dependency of @joplin/app-mobile, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/renderer dependency of @joplin/app-mobile, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/lib dependency of @joplin/app-mobile, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/fork-htmlparser2 dependency of @joplin/htmlpack, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/lib dependency of @joplin/plugin-repo-cli, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/tools dependency of @joplin/plugin-repo-cli, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/tools dependency of @joplin/server, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/lib dependency of @joplin/server, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/renderer dependency of @joplin/server, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/lib dependency of @joplin/tools, but links to different location. Replacing with updated symlink...
lerna WARN EREPLACE_OTHER Symlink already exists for @joplin/renderer dependency of @joplin/tools, but links to different location. Replacing with updated symlink...
lerna info lifecycle @joplin/app-clipper@1.0.8~postinstall: @joplin/app-clipper@1.0.8
lerna info lifecycle @joplin/app-desktop@2.6.2~postinstall: @joplin/app-desktop@2.6.2
lerna info lifecycle @joplin/app-mobile@0.8.9~postinstall: @joplin/app-mobile@0.8.9

> @joplin/app-clipper@1.0.8 postinstall C:\GSoc\Newfolder\joplin\packages\app-clipper
> cd popup && npm install


> joplin-webclipper-popup@0.1.0 postinstall
> node postinstall.js && npm run build


> joplin-webclipper-popup@0.1.0 build
> node scripts/build.js SKIP_PREFLIGHT_CHECK

Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Compiled successfully.

File sizes after gzip:

  47.92 KB  build\static\js\2.chunk.js
  8.53 KB   build\static\js\main.chunk.js
  775 B     build\static\js\runtime-main.js
  771 B     build\static\css\main.chunk.css

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  bit.ly/CRA-deploy


up to date, audited 1905 packages in 34s

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

82 vulnerabilities (57 moderate, 22 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

> @joplin/app-desktop@2.6.2 postinstall C:\GSoc\Newfolder\joplin\packages\app-desktop
> npm run build


> @joplin/app-desktop@2.6.2 build
> gulp build

[18:03:42] Using gulpfile C:\GSoc\Newfolder\joplin\packages\app-desktop\gulpfile.js
[18:03:42] Starting 'build'...
[18:03:42] Starting 'compileScripts'...
[18:03:42] Starting 'compilePackageInfo'...
[18:03:42] Starting 'copyPluginAssets'...
[18:03:42] Starting 'copyTinyMceLangs'...
[18:03:42] Starting 'updateIgnoredTypeScriptBuild'...
[18:03:42] Starting 'buildCommandIndex'...
[18:03:42] Starting 'compileSass'...
Compiling C:\GSoc\Newfolder\joplin\packages\app-desktop\tools/../gui/ExtensionBadge.jsx...

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'core-js/library/fn/object/keys'
Require stack:
- C:\GSoc\Newfolder\joplin\packages\app-desktop\node_modules\babel-runtime\core-js\object\keys.js
- C:\GSoc\Newfolder\joplin\packages\app-desktop\node_modules\babel-cli\lib\babel\index.js
- C:\GSoc\Newfolder\joplin\packages\app-desktop\node_modules\babel-cli\bin\babel.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (C:\GSoc\Newfolder\joplin\packages\app-desktop\node_modules\babel-runtime\core-js\object\keys.js:1:31)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\GSoc\\Newfolder\\joplin\\packages\\app-desktop\\node_modules\\babel-runtime\\core-js\\object\\keys.js',
    'C:\\GSoc\\Newfolder\\joplin\\packages\\app-desktop\\node_modules\\babel-cli\\lib\\babel\\index.js',
    'C:\\GSoc\\Newfolder\\joplin\\packages\\app-desktop\\node_modules\\babel-cli\\bin\\babel.js'
  ]
}

[18:03:43] The following tasks did not complete: build, compileScripts, compilePackageInfo, copyPluginAssets, copyTinyMceLangs, updateIgnoredTypeScriptBuild, buildCommandIndex, compileSass
[18:03:43] Did you forget to signal async completion?
lerna info lifecycle @joplin/app-desktop@2.6.2~postinstall: Failed to exec postinstall script

> @joplin/app-mobile@0.8.9 postinstall C:\GSoc\Newfolder\joplin\packages\app-mobile
> jetify && npm run build

npm ERR! code 1
npm ERR! path C:\GSoc\Newfolder\joplin
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npm run bootstrap --no-ci && npm run build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shikhar\AppData\Local\npm-cache\_logs\2021-11-25T12_33_43_582Z-debug.log``

I'm not sure what's going on there especially since I don't use Windows. JS tooling is a complete mess.
Maybe someone else will chime in.

So should I create a new topic or wait for someone else to reply in this one?