Comments (13)
Sent #103.
The problem is not very easy to solve. Basically what we are trying to achieve here is execute a script after installation. Now everything works fine if you are doing it as non-root. But since its at a global level, usually everyone's /usr/local/bin
is under root, therefore people will do sudo npm install -g
. Now the problem with this is npm by default will downgrade the user permission for postinstall scripts to nobody
when run as root. This is a problem for us because it does not allow to copy files under user's home directory.
There are a couple of solutions -
- Do not use the postinstall step at all. So users will have to run 2 commands(
install
andtldr --update
) to get started. - Pass
--unsafe-perm=true
in the installation step. This will use root permissions while installation which will make the.tldr
directory as root. - Not good. - Pass the
--user=<username>
option which will let npm use that user while executing the postinstall script.
I went with the 3rd option as that seemed to be the most reasonable compromise to me.
P.S. - How was this even pushed in the first place without testing ? The solution mentioned in the README is a complete hack. The wording if you are having problems
is untrue. It will always throw an error.
from tldr-node-client.
which is done now too !
from tldr-node-client.
I am working on a fix currently. Will send a PR soon.
from tldr-node-client.
Hi @xingped , this is a known issue. Please have a look at this https://github.com/tldr-pages/tldr-node-client#installing to solve your problem.
from tldr-node-client.
@zdroid any hints on how to resolve this? I'd also like us to make a new release since tldr-pages/tldr-python-client#7 is blocked on the theme support for the node client, which was introduced in #61 (after the latest release, 1.6.0).
from tldr-node-client.
@waldyrious He just has to do the workaround from README (npm install -g --ignore-scripts tldr && tldr --update
) and it'll be installed without errors.
About publishing new release: #101 is useful to be merged before new release is published, as it removes needless files from the package.
from tldr-node-client.
But shouldn't the errors not occur in the first place? Or is this an artifact of a previous installation, or...?
Also, shouldn't we update the obsolete dependencies to get rid of the warnings during installation? Is that something that we can fix by just changing the version numbers, or would we need to actually make changes in the code?
from tldr-node-client.
@waldyrious It's an issue related to how npm scripts are executed, most likely Linux-only. I had the same issue when I tried to install tldr without the workaround.
from tldr-node-client.
I had it too when I tried to update tldr (was on 1.4.0), which failed, so I uninstalled and reinstalled. This was on OS X, so it's not even platform-specific. I don't think the regular npm installation command should fail and require a workaround.
from tldr-node-client.
Agree. Maybe the issue is wrench.js-related, as the installation failed after it reached the wrench.js part? wrench.js is outdated anyway.
from tldr-node-client.
Nice analysis and explanation. I agree with the compromise you picked, seems to be the most reasonable one.
from tldr-node-client.
README is fixed. Waiting for the patch to be published to npm.
from tldr-node-client.
Well @agnivade, you can close the issue as it's fixed in latest version. It just has to be published.
from tldr-node-client.
Related Issues (20)
- > It is a reasonable request. But since the pages are internal to your team, I am wondering how much effort is it to just periodically fetch the master pages and add your local set of pages. If there are multiple remote sources to merge from, that would be a valid request as keeping multiple sources in sync would be difficult. HOT 1
- tldr --update failed HOT 2
- zsh autocompletion fails with: `(eval):1: bad pattern: [[`
- Version 3.3.8 is not available in npm, latest there is 3.3.7 HOT 7
- Language argument support HOT 1
- ENH: Mention number of new commands when doing `tldr -u` and maybe output a list of new commands as well
- Rendered emails become URL-encoded
- Highlight generic path placeholders differently
- Highlight number, string and boolean placeholders differently
- Transition from master to main branch HOT 2
- Permission error when running tldr HOT 1
- Feature request: update only specific languages in cache HOT 1
- bug: update command breaks when tldr repo has bad merge HOT 3
- Fetch individual translation archives for cache based on the environment variable configuration HOT 2
- Rendered output displays "See also:" line twice HOT 4
- Client specification v2.1 compliance: add placeholder escaping support
- Cannot update cache on Windows
- `tldr --list` output should be not in a single line
- `repository` in the config is not used anymore HOT 1
- Running tldr with a non-existent topic or doing an update causes long freezes HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tldr-node-client.