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

Error when npm installing 1.7.0 #163

Closed
esride-nik opened this issue Apr 18, 2019 · 16 comments
Closed

Error when npm installing 1.7.0 #163

esride-nik opened this issue Apr 18, 2019 · 16 comments

Comments

@esride-nik
Copy link

esride-nik commented Apr 18, 2019

Hey guys, it seems that there's an issue with the latest version. We tried on 3 different machines, all current NPM versions, in repos where it used to work before and in empty folders, and it always says:

npm ERR! path <DEV_PATH>\node_modules\node-jq\bin\jq
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '<DEV_PATH>\node_modules\node-jq\bin\jq'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

Installing an older version works: npm install node-jq@1.5.0

@davesnx
Copy link
Member

davesnx commented Apr 18, 2019

Thanks for reporting, I will take a look.

@davesnx
Copy link
Member

davesnx commented Apr 18, 2019

I was taking a look at the issue happened https://ci.appveyor.com/project/sanack/node-jq/builds/23923362/job/299dacxnfpog3a78 and seems that it's a node error happening when you try to change the permissions to downloaded jq.

The issue posted on nodejs is here nodejs/node#20498

@davesnx
Copy link
Member

davesnx commented Apr 18, 2019

Could you try with node-jq@1.7.1?

@jakobwgnr
Copy link

jakobwgnr commented Apr 19, 2019

hello! Getting the same error when trying to install 1.7.1

FYI don't know if relevant - I'm working on a windows machine!

Installing 1.5.0 works fine for me as well

@sirpy
Copy link
Contributor

sirpy commented Apr 23, 2019

1.6.0 works on macosx 1.7+ doesnt.

fernandomg added a commit to GoodDollar/GoodContracts that referenced this issue Apr 29, 2019
- There where issues when trying to install a greater version: sanack/node-jq#163
@davesnx
Copy link
Member

davesnx commented May 7, 2019

1.6.0 works on macosx 1.7+ doesnt.

Which error are you facing?

@davesnx
Copy link
Member

davesnx commented May 9, 2019

I tried personally, and fails only with npm (my version is 6.4.1).

Could you share your npm's version @sirpy @jakobwgnr

@davesnx
Copy link
Member

davesnx commented May 9, 2019

It's fixed in @1.8.1

The key bin inside the packagejson makes npm (and not yarn) to change the permisions just before the install (before the install script too), this is why it was failing. I lost my head a little bit here...

Sorry for the apologies folks!

@davesnx davesnx closed this as completed May 9, 2019
@kseniamukhortova
Copy link

Hi! I'm using version 1.12.0 and the issue is reappearing on unix. Bin folder is missing in node_modules/node-jq after yarn install

@davesnx
Copy link
Member

davesnx commented May 27, 2021

Can you make a reproduction example that I can look into?

@kseniamukhortova
Copy link

It turned out that bin folder is missing if I call yarn install --ignore-scripts - I needed this flag for own purposes but wasn't aware it will affect jq binary installation

@kseniamukhortova
Copy link

It is also very unfortunate, that after it is installed without bin folder, further calls to 'yarn install' (without --ignore-scripts flag) don't end up in installing bin, as it supposes everything is installed already.

@davesnx
Copy link
Member

davesnx commented May 28, 2021

Right, --ignore-scripts will not run the npm post-install scripts, which in node-jq case, installs the jq binary from github.

I'm not sure if I understand this part:

It is also very unfortunate, that after it is installed without bin folder, further calls to 'yarn install' (without --ignore-scripts flag) don't end up in installing bin, as it supposes everything is installed already

If you want to keep the --ignore-scripts in your installation, I think there are 2 options available:

  1. Run npm install --ignore-scripts (and keep node-jq outside of the dependencies) and run npm install node-jq separately.
  2. Keep the npm install --ignore-scripts, but make sure you have jq installed in your system and available in $PATH.

Hope this helps

@kseniamukhortova
Copy link

Thanks, will give it a try! Probably, it would be good to note in the documentation somewhere that node-jq requires postinstall scripts to be run.

@davesnx
Copy link
Member

davesnx commented May 28, 2021

There's a paragraph explaining that:

By default, node-jq downloads jq on the installation process (when you run npm install node-jq). Downloads the binaries according to your SO.

Will improve it, Thanks

@kseniamukhortova
Copy link

kseniamukhortova commented May 28, 2021

Keep the npm install --ignore-scripts, but make sure you have jq installed in your system and available in $PATH.

BTW, I have it installed in the system,
which jq
/usr/bin/jq

but I had the same ENOENT crash saying it was not found in node_modules/node-jq/bin/jq.
My workaround was to pass the '/usr/bin/jq' into 'run' method as the forth optional parameter, then it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants