neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

Install with specific node & npm directory #402

Closed mescande closed 1 year ago

mescande commented 1 year ago

Hi, I'm trying to install via CocInstall coc-tsserver, but as I don't have a common configuration (and can't have it), my node & npm execs are in a specific directory. I setted up my coc-settings.json :

{
    "npm.binPath": "/mypath/.node/bin/npm",
    "node.binPath": "/mypath/.node/bin/node",
}

And Download starts and finish succesfully, but then, this occurs : - ✗ coc-tsserver /mnt/nfs/homes/mescande/.node/bin/npm install exited with 127 And here is the detail :

Using npm from: /mypath/.node/bin/npm
Get info from https://registry.npmjs.org/
Downloading from https://registry.npmjs.org/coc-tsserver/-/coc-tsserver-1.11.7.tgz
Download progress 0.8%
[ . . .]
Download progress 100.0%
Extension download at /tmp/nvimyXkKk6/coc-tsserver-hMHseo
Installing dependencies by: /mypath/.node/bin/npm install --ignore-scripts --no-lockfile --production --legacy-peer-deps --no-global.
/usr/bin/env: ‘node’: No such file or directory
/mypath/.node/bin/npm install exited with 127

I searched for a specific mention of node or his path, and try to set it via "eslint.nodePath" but it didn't work either

If you could help me it would be fantastic !

chemzqm commented 1 year ago

Edit your /mypath/.node/bin/npm and replace #!/usr/bin/env node with /mypath/.node/bin/node, or fix your $PATH to add /mypath/.node/bin

mescande commented 1 year ago

Thank you, problem solved !