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

install 9.15.1 fail #1984

Closed
fengmk2 opened this Issue Feb 25, 2019 · 62 comments

Comments

Projects
None yet
@fengmk2
Copy link

fengmk2 commented Feb 25, 2019

Error: ENOENT: no such file or directory, chmod '.../node_modules/_highlight.js@9.15.1@highlight.js/tools/build.js'

missing tools/build.js file.

@fengmk2

This comment has been minimized.

Copy link
Author

fengmk2 commented Feb 25, 2019

It cause by ee2ae80#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R25

@czy88840616

This comment has been minimized.

Copy link

czy88840616 commented Feb 25, 2019

it cause error in npm install.
image

@dindurthy

This comment has been minimized.

Copy link

dindurthy commented Feb 25, 2019

+1

@zomble

This comment has been minimized.

Copy link

zomble commented Feb 25, 2019

Same here.

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 25, 2019

Apologies, will fix in ~2 hours unless someone wants to put together a pull request quickly.

@lixiaolihua

This comment has been minimized.

Copy link

lixiaolihua commented Feb 25, 2019

+1

@czy88840616

This comment has been minimized.

Copy link

czy88840616 commented Feb 25, 2019

Could you change latest tag in npm to fix this problem quickly?

@mchaov

This comment has been minimized.

Copy link

mchaov commented Feb 25, 2019

+1

@sirjones

This comment has been minimized.

Copy link

sirjones commented Feb 25, 2019

+1

4 similar comments
@serjout

This comment has been minimized.

Copy link

serjout commented Feb 25, 2019

+1

@nbivanov

This comment has been minimized.

Copy link

nbivanov commented Feb 25, 2019

+1

@hartja

This comment has been minimized.

Copy link

hartja commented Feb 25, 2019

+1

@XKhumalo

This comment has been minimized.

Copy link

XKhumalo commented Feb 25, 2019

+1

@sirjones

This comment has been minimized.

Copy link

sirjones commented Feb 25, 2019

For those in a hurry (Like I was). You can download the repo and install it locally with npm and it works fine

@jamesleegovtech

This comment has been minimized.

Copy link

jamesleegovtech commented Feb 25, 2019

+1

1 similar comment
@EndyKaufman

This comment has been minimized.

Copy link

EndyKaufman commented Feb 25, 2019

+1

@JessicaSachs

This comment has been minimized.

Copy link

JessicaSachs commented Feb 25, 2019

Also a work around for dependent packages is to install 9.15.0 as a peer dependency via npm i highlight.js@9.15.0 -D

@grigoreme

This comment has been minimized.

Copy link

grigoreme commented Feb 25, 2019

+1

@RedTailBullet

This comment has been minimized.

Copy link

RedTailBullet commented Feb 25, 2019

So it's not fixed yet?

@zhaoqin-github

This comment has been minimized.

Copy link

zhaoqin-github commented Feb 25, 2019

Waiting for a fix...

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 25, 2019

Starting to work on the fix. I’m muting the bug, as it’s getting spammy. If you’d like to subscribe to the bug, to be notified when it’s fixed, please use the subscribe button.

@highlightjs highlightjs locked as spam and limited conversation to collaborators Feb 25, 2019

@highlightjs highlightjs unlocked this conversation Feb 25, 2019

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 25, 2019

Ok, can a few folks try:

npm install github:highlightjs/highlight.js#fix_build
npx hljs 

Let me know if that works...

@zhang-shengping

This comment has been minimized.

Copy link

zhang-shengping commented Feb 25, 2019

npx hljs 

I have tried it, It works for me.

@tati tati referenced this issue Feb 25, 2019

Closed

pin version #91

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 25, 2019

@isagalaev is right. We maintainers do the best we can, and it's definitely not part of our day job. There are a few solutions people can use to protect themselves from these kinds of events:

  • lock dependency to a particular version number.
  • rely on a service like https://greenkeeper.io - which will check that an updates doesn't break your build.
  • always test before updating, don't blindly just go for "latest".

@highlightjs highlightjs unlocked this conversation Feb 25, 2019

@ljharb

This comment has been minimized.

Copy link

ljharb commented Feb 25, 2019

One suggestion that might make it easier for maintainers would be to use a prepublish script, rather than having a separate release script - that way, npm publish can't proceed until that script passes.

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 26, 2019

@ljharb, that's a good suggestion. I'd also like to write a better check on TravisCI. I wasn't expecting the package to be stripped of some of its contents.

I'll write an incident report and publish it here describing what happened and what we will try to improve to prevent this from happening again.

Again, this is a call for the community to help us (we literally run this project on a skeleton crew... putting in maybe 1 hour a month to keeping it running). I'm definitely not an expert on NPM - so help from folks with more experience would be greatly appreciated to keep this project healthy.

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 26, 2019

Folks, I've published 9.15.5.... any better? 🤞

@das-peter

This comment has been minimized.

Copy link

das-peter commented Feb 26, 2019

@marcoscaceres Our build system is all green again - got the latest 9.15.5 version as npm lists that version now too.
@isagalaev & @marcoscaceres Thanks for your efforts, appreciated very much :)

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 26, 2019

incident report

What happened?

About a week ago we merged #1951, which made changes to the tools/build.js utility by excluding certain files (docs, demos, and other things). The PR's intention was to have a way to build a highlight bundle from the command line, but to not build the docs and demos that are not needed on CI environments.

Although we'd been thoroughly testing this binary in production in another project for over a year, we'd been installing highlight.js over a github: URL. Unknown to me, the highlight.js npm publish script only included certain files: The script is on an ex-maintainer's private server, so I'd incorrectly assumed that it was publishing the repository as is. This assumption was wrong and led to things breaking.

When 9.15.1 release went live, it was missing tools/build.js and possibly other things causing depedents to break.

What we did in response

At first, I thought the problem was that the bin path was maybe wrong. However, thanks to helpful #1984 (comment) from @netanelgilad, it was pointed out that the problem was with how the package was being published: it was missing directories/files.

As a result, I reverted #1951. However, this was insufficient because we'd changed our release script to work with the new tools/build.js. We then needed to revert some changes to the release script.

After a few bad releases, we then successfully published 9.15.5.

What we learned

Keeping in mind that the maintainers are new to the project:

  • the published package does not reflect what's in the repository.

What could we do to prevent this from happening again

We need to figure out a way to pre-publish (or publish as "beta") a package, and then try to install the package in a mock project to make sure things still work as expected.

If folks have suggestion for how to do that - or what a good setup might be to test what's actually published before it goes live, I'd be open to suggestions.

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 26, 2019

I'll wait for a few more confirmation that things are back in a good state before closing. Will keep an eye on things throughout the day.

@zhaoqin-github

This comment has been minimized.

Copy link

zhaoqin-github commented Feb 26, 2019

@marcoscaceres My system can accomplish npm install now. The installed highlight.js version is 9.15.5. Thanks for you fix!

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 26, 2019

Thanks for confirming @zhaoqin-github.

@loooSwc

This comment has been minimized.

Copy link

loooSwc commented Feb 26, 2019

success+1

@sunrise9527

This comment has been minimized.

Copy link

sunrise9527 commented Feb 26, 2019

Quick solution: npm install highlight.js@9.12.0 --save and then run npm shrinkwrap, fix all version info into npm-shrinkwrapwrap.json file, then run npm install. It works for our project

@ljharb

This comment has been minimized.

Copy link

ljharb commented Feb 26, 2019

@marcoscaceres if you enable 2FA for this package (which you should, regardless) then when you run npm publish, before it actually publishes, it will print out a summary of which files will be included in the package and then prompt you for your one time password. I often use this to ensure my packages have the required files.

@ernestoort

This comment has been minimized.

Copy link

ernestoort commented Feb 26, 2019

I can tell you it is working right now. I have a project that depends of typedoc, hence this project.

Being honest, you give me a lot of headaches today. For me today was a Murphy moment that ended with this incident today.

I'm not blaming you. This is an open source project and we have to be aware this things are going to happen.

And personally, I PREFER, 100x times, an open source project like this one that a private one with no documents.

@lifuyao

This comment has been minimized.

Copy link

lifuyao commented Feb 26, 2019

I also met this issue yesterday, thanks for resolving it

@marcoscaceres

This comment has been minimized.

Copy link
Collaborator

marcoscaceres commented Feb 26, 2019

Ok, seems we are good... closing.

bodia-uz added a commit to wix/okidoc that referenced this issue Feb 26, 2019

Revert "chore(okidoc-md): freeze highlight.js version (okidoc-md -> d…
…ocumentationjs -> highlightjs)"

This reverts commit 00abb33.

related issue highlightjs/highlight.js#1984

bodia-uz added a commit to wix/playable that referenced this issue Feb 26, 2019

Revert "fix: temporary fix `okdidoc>documentationjs>highlight.js` by …
…frezing `highlight.js` dep"

This reverts commit 433d54f.

related issue highlightjs/highlight.js#1984
@alasdairhurst

This comment has been minimized.

Copy link

alasdairhurst commented Feb 26, 2019

If folks have suggestion for how to do that - or what a good setup might be to test what's actually published before it goes live, I'd be open to suggestions.

There are a few ways to go about this -

  • Publish each release, potentially each time master builds, with a prerelease version indicated by a dash at the end: x.x.x-0
    these can be individually tested just like regular versions, but users won't pick them up by default, and it's clear that they may have potential bugs. When it's ready to release, test the latest prerelease and if it works, trim the prerelease part from the version and do a release.
  • Another approach (which could be done alongside the latter) is to make use of npm tags. When you release a new version, tag with "next" rather than "latest" and test it. If it works, only then change the tag to "latest". That way even if 9.16.0 is released after 9.15.5, as long as it's marked "next", people depending on "^9.0.0" won't pick it up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.