typeorm: no such file or directory highlight.js/tools/build.js when installing typeorm

Issue type:

[ ] question [x] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ ] oracle [ ] postgres [ ] sqlite [ ] sqljs [ ] react-native [ ] expo

TypeORM version:

[x] latest [ ] @next [ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem: I tried to install typeorm in a clean new directory (no other dependencies except typeorm) and I got this error: ENOENT: no such file or directory, chmod '/Users/user/dev/nestjs-custom-base-entity/node_modules/highlight.js/tools/build.js'

Also happens when I tried to install typeorm globally with sudo. tried to clean npm cache couple of time.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 27
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Works for me when I run npm i typeorm --no-bin-links

Looks like this is a bug from highlight.js latest version https://github.com/highlightjs/highlight.js/issues/1984

Looks like this is a bug from highlight.js latest version highlightjs/highlight.js#1984

My solution: npm i highlight.js@9.14.2 -D. They have solved this problem,waiting for the new version.

Oh my freaking god!!

https://github.com/typeorm/typeorm/blob/master/src/commands/SchemaLogCommand.ts#L60 https://github.com/typeorm/typeorm/blob/master/src/platform/PlatformTools.ts#L3 https://github.com/typeorm/typeorm/blob/master/src/commands/SchemaLogCommand.ts#L4

It is insane for highlighting and console log typeorm is broken 😄 It is strange also that CLI is not separated from the main build 😉

Try use yarn It’s solved for me

Can you please use provided solution for now?

npm i highlight.js@9.14.2 -D

We just need to wait when highlight.js fix their issue, its a critical issue, I’m sure they will fix it very soon.

Seems that typeorm depends on cli-highlight which itself depends on highlight.js 9.6.0

Typeorm package.json dependencies :

"dependencies": {
    "app-root-path": "^2.0.1",
    "buffer": "^5.1.0",
    "chalk": "^2.3.2",
    "cli-highlight": "^1.2.3",
    "debug": "^3.1.0",
    "dotenv": "^5.0.1",
    "glob": "^7.1.2",
    "js-yaml": "^3.11.0",
    "mkdirp": "^0.5.1",
    "reflect-metadata": "^0.1.12",
    "xml2js": "^0.4.17",
    "yargonaut": "^1.1.2",
    "tslib": "^1.9.0",
    "yargs": "^12.0.5"
  },

cli-highlight package.json dependencies :

"dependencies": {
    "chalk": "^2.3.0",
    "highlight.js": "^9.6.0",
    "mz": "^2.4.0",
    "parse5": "^4.0.0",
    "yargs": "^11.0.0"
  },

How would this workaround work on a deployment server’s npm install?

Got the same issue. Thanks for the quickfix @yogevlahyani