Theia: Getting error on start: internal/modules/cjs/loader.js:638 throw err;

Created on 14 Apr 2020  路  23Comments  路  Source: eclipse-theia/theia

Description

I am building an IDE on Theia for a month now and it's working completely fine until three days ago when my Theia application just wouldn't start. It builds normally, but it doesn't start.

yarn start:browser and yarn start:electron both are having issues.

Screen Shot 2020-04-14 at 4 57 05 PM

Reproduction Steps

To reproduce, please follow these steps:

  1. Clone Theia repo
  2. Run yarn
  3. Run yarn start:browser or yarn start:electron

Versions:

Node: v10.20.1
NVM: 0.35.3
NPM: 6.14.4
OS: macOS Catalina 10.15.4 (19E287) _[latest]_

Solutions already done

I have tried every single solution that I found on the internet regarding this issue. I also uninstalled and installed Node and NVM twice. But that didn't help.

question

Most helpful comment

I meet this thing锛宨nternal/modules/cjs/loader.js:638 ,how to solve it?

All 23 comments

@TheQureshi please see if the following changes solve your issue?

I have tried every single solution that I found on the internet regarding this issue. I also uninstalled and installed Node and NVM twice. But that didn't help.

@TheQureshi, please use resolutions as a temporary workaround in the package.json as suggested here:

  "resolutions": {
    "**/**/nsfw": "1.2.7"
   },

Closing.

@TheQureshi please see if the following changes solve your issue?

  • #7535

@vince-fugnitto tried but the issue is still there.

@TheQureshi please see if the following changes solve your issue?

  • #7535

@vince-fugnitto tried but the issue is still there.

When trying, did you also update the yarn.lock? If not, I suspect it's pinning an older version.

I have tried every single solution that I found on the internet regarding this issue. I also uninstalled and installed Node and NVM twice. But that didn't help.

@TheQureshi, please use resolutions as a temporary workaround in the package.json as suggested here:

  "resolutions": {
    "**/**/nsfw": "1.2.7"
   },

Closing.

@kittaakos this didn't help mate!

@TheQureshi please see if the following changes solve your issue?

  • #7535

@vince-fugnitto tried but the issue is still there.

When trying, did you also update the yarn.lock? If not, I suspect it's pinning an older version.

Yes I updated yarn.lock and packages/core/package.json both files

@kittaakos this didn't help mate!

Did you do this in your main package.json?

@kittaakos this didn't help mate!

Did you do this in your main package.json?

Yes!

Do you have code to share?

package.json file after applying fixed suggested here.

{
  "private": true,
  "name": "@theia/monorepo",
  "version": "0.0.0",
  "engines": {
    "yarn": "1.0.x || >=1.2.1",
    "node": ">=10.11.0 <12"
  },
  "resolutions": {
    "**/**/nsfw": "1.2.7",
    "**/@types/node": "~10.3.6",
    "**/vscode-json-languageserver/**/vscode-languageserver": "6.0.0-next.1"
  },
  "devDependencies": {
    "@types/chai-string": "^1.4.0",
    "@types/jsdom": "^11.0.4",
    "@types/node": "~10.3.6",
    "@types/sinon": "^2.3.5",
    "@types/temp": "^0.8.29",
    "@types/uuid": "^3.4.3",
    "@typescript-eslint/eslint-plugin": "^2.16.0",
    "@typescript-eslint/eslint-plugin-tslint": "^2.16.0",
    "@typescript-eslint/parser": "^2.16.0",
    "chai-string": "^1.4.0",
    "colors": "^1.4.0",
    "concurrently": "^3.5.0",
    "electron-mocha": "^8.2.0",
    "eslint": "^6.8.0",
    "eslint-plugin-import": "^2.20.0",
    "eslint-plugin-no-null": "^1.0.2",
    "ignore-styles": "^5.0.1",
    "jsdom": "^11.5.1",
    "lerna": "^2.2.0",
    "nyc": "^15.0.0",
    "rimraf": "^2.6.1",
    "sinon": "^3.3.0",
    "temp": "^0.8.3",
    "tslint": "^5.12.0",
    "typedoc": "^0.15.0-0",
    "typedoc-plugin-external-module-map": "^1.0.0",
    "typescript": "~3.5.3",
    "uuid": "^3.2.1"
  },
  "scripts": {
    "preinstall": "node-gyp install",
    "postinstall": "node scripts/post-install.js",
    "prepare": "yarn prepare:travis && yarn prepare:references && yarn prepare:build && yarn prepare:hoisting && yarn download:plugins",
    "prepare:travis": "node scripts/prepare-travis.js",
    "prepare:references": "node scripts/compile-references.js",
    "prepare:build": "yarn build && run lint && run build \"@theia/example-*\" --stream --parallel",
    "prepare:hoisting": "theia check:hoisted -s",
    "clean": "yarn lint:clean && node scripts/run-reverse-topo.js yarn clean",
    "build": "tsc -b configs/root-compilation.tsconfig.json --verbose",
    "watch": "tsc -b configs/root-compilation.tsconfig.json -w",
    "lint": "run lint",
    "lint:clean": "rimraf .eslintcache",
    "lint:oneshot": "node --max-old-space-size=4096 node_modules/eslint/bin/eslint.js --cache=true \"{dev-packages,packages,examples}/**/*.{ts,tsx}\"",
    "docs": "rimraf gh-pages/docs/next && typedoc --tsconfig configs/typedoc-tsconfig.json --options configs/typedoc.json",
    "test": "yarn test:references && yarn test:theia && yarn test:electron && yarn test:browser",
    "test:references": "node scripts/compile-references --dry-run",
    "test:theia": "run test \"@theia/!(example-)*\" --stream --concurrency=1",
    "test:browser": "yarn rebuild:browser && run test \"@theia/example-browser\"",
    "test:electron": "yarn rebuild:electron && run test \"@theia/example-electron\"",
    "rebuild:clean": "rimraf .browser_modules",
    "rebuild:browser": "theia rebuild:browser",
    "rebuild:electron": "theia rebuild:electron",
    "rebuild:electron:debug": "DEBUG=electron-rebuild && yarn rebuild:electron",
    "publish": "yarn && yarn test && yarn publish:latest",
    "publish:latest": "lerna publish && yarn publish:check",
    "publish:next": "yarn next:publish && yarn next:publish --skip-npm && yarn publish:check",
    "next:publish": "lerna publish --exact --canary=next --npm-tag=next --yes",
    "publish:check": "node scripts/check-publish.js",
    "start:browser": "yarn rebuild:browser && yarn --cwd examples/browser start",
    "start:electron": "yarn rebuild:electron && yarn --cwd examples/electron start",
    "download:plugins": "theia download:plugins"
  },
  "workspaces": [
    "dev-packages/*",
    "packages/*",
    "examples/*"
  ],
  "theiaPluginsDir": "plugins",
  "theiaPlugins": {
    "vscode-builtin-bat": "http://open-vsx.org/api/vscode/bat/1.39.1/file/vscode.bat-1.39.1.vsix",
    "vscode-builtin-clojure": "http://open-vsx.org/api/vscode/clojure/1.39.1/file/vscode.clojure-1.39.1.vsix",
    "vscode-builtin-coffeescript": "http://open-vsx.org/api/vscode/coffeescript/1.39.1/file/vscode.coffeescript-1.39.1.vsix",
    "vscode-builtin-configuration-editing": "http://open-vsx.org/api/vscode/configuration-editing/1.39.1/file/vscode.configuration-editing-1.39.1.vsix",
    "vscode-builtin-cpp": "http://open-vsx.org/api/vscode/cpp/1.39.1/file/vscode.cpp-1.39.1.vsix",
    "vscode-builtin-csharp": "http://open-vsx.org/api/vscode/csharp/1.39.1/file/vscode.csharp-1.39.1.vsix",
    "vscode-builtin-css": "http://open-vsx.org/api/vscode/css/1.39.1/file/vscode.css-1.39.1.vsix",
    "vscode-builtin-debug-auto-launch": "http://open-vsx.org/api/vscode/debug-auto-launch/1.39.1/file/vscode.debug-auto-launch-1.39.1.vsix",
    "vscode-builtin-docker": "http://open-vsx.org/api/vscode/docker/1.39.1/file/vscode.docker-1.39.1.vsix",
    "vscode-builtin-emmet": "http://open-vsx.org/api/vscode/emmet/1.39.1/file/vscode.emmet-1.39.1.vsix",
    "vscode-builtin-fsharp": "http://open-vsx.org/api/vscode/fsharp/1.39.1/file/vscode.fsharp-1.39.1.vsix",
    "vscode-builtin-go": "http://open-vsx.org/api/vscode/go/1.39.1/file/vscode.go-1.39.1.vsix",
    "vscode-builtin-groovy": "http://open-vsx.org/api/vscode/groovy/1.39.1/file/vscode.groovy-1.39.1.vsix",
    "vscode-builtin-grunt": "http://open-vsx.org/api/vscode/grunt/1.39.1/file/vscode.grunt-1.39.1.vsix",
    "vscode-builtin-gulp": "http://open-vsx.org/api/vscode/gulp/1.39.1/file/vscode.gulp-1.39.1.vsix",
    "vscode-builtin-handlebars": "http://open-vsx.org/api/vscode/handlebars/1.39.1/file/vscode.handlebars-1.39.1.vsix",
    "vscode-builtin-hlsl": "http://open-vsx.org/api/vscode/hlsl/1.39.1/file/vscode.hlsl-1.39.1.vsix",
    "vscode-builtin-html": "http://open-vsx.org/api/vscode/html/1.39.1/file/vscode.html-1.39.1.vsix",
    "vscode-builtin-ini": "http://open-vsx.org/api/vscode/ini/1.39.1/file/vscode.ini-1.39.1.vsix",
    "vscode-builtin-jake": "http://open-vsx.org/api/vscode/jake/1.39.1/file/vscode.jake-1.39.1.vsix",
    "vscode-builtin-java": "http://open-vsx.org/api/vscode/java/1.39.1/file/vscode.java-1.39.1.vsix",
    "vscode-builtin-javascript": "http://open-vsx.org/api/vscode/javascript/1.39.1/file/vscode.javascript-1.39.1.vsix",
    "vscode-builtin-json": "http://open-vsx.org/api/vscode/json/1.39.1/file/vscode.json-1.39.1.vsix",
    "vscode-builtin-less": "http://open-vsx.org/api/vscode/less/1.39.1/file/vscode.less-1.39.1.vsix",
    "vscode-builtin-log": "http://open-vsx.org/api/vscode/log/1.39.1/file/vscode.log-1.39.1.vsix",
    "vscode-builtin-lua": "http://open-vsx.org/api/vscode/lua/1.39.1/file/vscode.lua-1.39.1.vsix",
    "vscode-builtin-make": "http://open-vsx.org/api/vscode/make/1.39.1/file/vscode.make-1.39.1.vsix",
    "vscode-builtin-markdown": "http://open-vsx.org/api/vscode/markdown/1.39.1/file/vscode.markdown-1.39.1.vsix",
    "vscode-builtin-markdown-language-features": "http://open-vsx.org/api/vscode/markdown-language-features/1.39.1/file/vscode.markdown-language-features-1.39.1.vsix",
    "vscode-builtin-merge-conflict": "http://open-vsx.org/api/vscode/merge-conflict/1.39.1/file/vscode.merge-conflict-1.39.1.vsix",
    "vscode-builtin-npm": "http://open-vsx.org/api/vscode/npm/1.39.1/file/vscode.npm-1.39.1.vsix",
    "vscode-builtin-node-debug": "http://open-vsx.org/api/ms-vscode/node-debug/1.44.2/file/ms-vscode.node-debug-1.44.2.vsix",
    "vscode-builtin-node-debug2": "http://open-vsx.org/api/ms-vscode/node-debug2/1.33.0/file/ms-vscode.node-debug2-1.33.0.vsix",
    "vscode-builtin-objective-c": "http://open-vsx.org/api/vscode/objective-c/1.39.1/file/vscode.objective-c-1.39.1.vsix",
    "vscode-builtin-perl": "http://open-vsx.org/api/vscode/perl/1.39.1/file/vscode.perl-1.39.1.vsix",
    "vscode-builtin-powershell": "http://open-vsx.org/api/vscode/powershell/1.39.1/file/vscode.powershell-1.39.1.vsix",
    "vscode-builtin-pug": "http://open-vsx.org/api/vscode/pug/1.39.1/file/vscode.pug-1.39.1.vsix",
    "vscode-builtin-python": "http://open-vsx.org/api/vscode/python/1.39.1/file/vscode.python-1.39.1.vsix",
    "vscode-builtin-r": "http://open-vsx.org/api/vscode/r/1.39.1/file/vscode.r-1.39.1.vsix",
    "vscode-builtin-razor": "http://open-vsx.org/api/vscode/razor/1.39.1/file/vscode.razor-1.39.1.vsix",
    "vscode-builtin-ruby": "http://open-vsx.org/api/vscode/ruby/1.39.1/file/vscode.ruby-1.39.1.vsix",
    "vscode-builtin-rust": "http://open-vsx.org/api/vscode/rust/1.39.1/file/vscode.rust-1.39.1.vsix",
    "vscode-builtin-scss": "http://open-vsx.org/api/vscode/scss/1.39.1/file/vscode.scss-1.39.1.vsix",
    "vscode-builtin-shaderlab": "http://open-vsx.org/api/vscode/shaderlab/1.39.1/file/vscode.shaderlab-1.39.1.vsix",
    "vscode-builtin-shellscript": "http://open-vsx.org/api/vscode/shellscript/1.39.1/file/vscode.shellscript-1.39.1.vsix",
    "vscode-builtin-sql": "http://open-vsx.org/api/vscode/sql/1.39.1/file/vscode.sql-1.39.1.vsix",
    "vscode-builtin-swift": "http://open-vsx.org/api/vscode/swift/1.39.1/file/vscode.swift-1.39.1.vsix",
    "vscode-builtin-theme-abyss": "http://open-vsx.org/api/vscode/theme-abyss/1.39.1/file/vscode.theme-abyss-1.39.1.vsix",
    "vscode-builtin-theme-defaults": "http://open-vsx.org/api/vscode/theme-defaults/1.39.1/file/vscode.theme-defaults-1.39.1.vsix",
    "vscode-builtin-theme-kimbie-dark": "http://open-vsx.org/api/vscode/theme-kimbie-dark/1.39.1/file/vscode.theme-kimbie-dark-1.39.1.vsix",
    "vscode-builtin-theme-monokai": "http://open-vsx.org/api/vscode/theme-monokai/1.39.1/file/vscode.theme-monokai-1.39.1.vsix",
    "vscode-builtin-theme-monokai-dimmed": "http://open-vsx.org/api/vscode/theme-monokai-dimmed/1.39.1/file/vscode.theme-monokai-dimmed-1.39.1.vsix",
    "vscode-builtin-theme-quietlight": "http://open-vsx.org/api/vscode/theme-quietlight/1.39.1/file/vscode.theme-quietlight-1.39.1.vsix",
    "vscode-builtin-theme-red": "http://open-vsx.org/api/vscode/theme-red/1.39.1/file/vscode.theme-red-1.39.1.vsix",
    "vscode-builtin-theme-solarized-dark": "http://open-vsx.org/api/vscode/theme-solarized-dark/1.39.1/file/vscode.theme-solarized-dark-1.39.1.vsix",
    "vscode-builtin-theme-tomorrow-night-blue": "http://open-vsx.org/api/vscode/theme-tomorrow-night-blue/1.39.1/file/vscode.theme-tomorrow-night-blue-1.39.1.vsix",
    "vscode-builtin-typescript": "http://open-vsx.org/api/vscode/typescript/1.39.1/file/vscode.typescript-1.39.1.vsix",
    "vscode-builtin-typescript-language-features": "http://open-vsx.org/api/vscode/typescript-language-features/1.39.1/file/vscode.typescript-language-features-1.39.1.vsix",
    "vscode-builtin-vb": "http://open-vsx.org/api/vscode/vb/1.39.1/file/vscode.vb-1.39.1.vsix",
    "vscode-builtin-icon-theme-seti": "http://open-vsx.org/api/vscode/vscode-theme-seti/1.39.1/file/vscode.vscode-theme-seti-1.39.1.vsix",
    "vscode-builtin-xml": "http://open-vsx.org/api/vscode/xml/1.39.1/file/vscode.xml-1.39.1.vsix",
    "vscode-builtin-yaml": "http://open-vsx.org/api/vscode/yaml/1.39.1/file/vscode.yaml-1.39.1.vsix",
    "vscode-editorconfig": "https://open-vsx.org/api/EditorConfig/EditorConfig/0.14.4/file/EditorConfig.EditorConfig-0.14.4.vsix",
    "vscode-eslint": "http://open-vsx.org/api/dbaeumer/vscode-eslint/2.1.1/file/dbaeumer.vscode-eslint-2.1.1.vsix",
    "vscode-references-view": "http://open-vsx.org/api/ms-vscode/references-view/0.0.47/file/ms-vscode.references-view-0.0.47.vsix"
  }
}

@TheQureshi please try a clean (git clean -fdx), and rebuild when applying the resolutions block?

What does your "postinstall": "node scripts/post-install.js", do?

@TheQureshi, I cannot do much with the package.json you have attached. I still believe you have the same issue as described in #7510, but maybe I am wrong.

I am reopening for better visibility; maybe someone knows the fix.

@TheQureshi, I cannot do much with the package.json you have attached. I still believe you have the same issue as described in #7510, but maybe I am wrong.

I believe it's the package.json from the root of the repo?
I think his issue mentioned he was unable to build the main repo from sources.

Pinning nsfw should not be necessary, latest version 1.2.9 is good. Could you share the repo?

@TheQureshi please try a clean (git clean -fdx), and rebuild when applying the resolutions block?

I am testing things out by just downloading the .zip from eclipse-theia/theia repo. So git clean doesn't apply to me. Or does it?

What does your "postinstall": "node scripts/post-install.js", do?

I am not sure what that does. I just got my package.json from eclipse-theia/theia master repo.

@TheQureshi, I cannot do much with the package.json you have attached. I still believe you have the same issue as described in #7510, but maybe I am wrong.

I went through the issue you mentioned and tried the solution suggested there. No luck.

I am reopening for better visibility; maybe someone knows the fix.

Thanks 馃憤

I believe it's the package.json from the root of the repo?

@vince-fugnitto yes, this is from the root of the repo.

I think his issue mentioned he was unable to build the main repo from sources.

I didn't quite get it.

Could you share the repo?

@akosyakov I just downloaded .zip from eclipse-theia/theia master repo and didn't make any changes except for the changes suggested here.

If not already done so, can you make sure that you have the necessary prerequisites installed?

@vince-fugnitto I just went through the prerequisites and I have double checked that I have installed everything required on my system.

However, it was mentioned that Node v10.15.3 is preferred so I downgraded from 10.22.1 using NVM.

Doing so had no effect on the error except one thing. The number changed from 638 to 584. Previously, I was getting internal/modules/cjs/loader.js:638 throw err; and now I am getting internal/modules/cjs/loader.js:584 throw err;

I meet this thing锛宨nternal/modules/cjs/loader.js:638 ,how to solve it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akosyakov picture akosyakov  路  3Comments

vince-fugnitto picture vince-fugnitto  路  3Comments

akosyakov picture akosyakov  路  3Comments

kpge picture kpge  路  3Comments

Beetix picture Beetix  路  3Comments