n: "npm install xyz" produces "asyncWrite is not a function"

Issue Template:

Describe issue including what OS you are using

I’m using CentOS

Describe what version of N you have

–version output: 2.1.11

Describe how you installed N

npm install -g n_

Steps to reproduce issue 1.2.3

i.e.

  1. n latest

What version of npm you are using

npm --version output: 6.1.0

Additional information you deem important (e.g. issue happens only occasionally):

  • Output of which n: 2.1.11
  • Output of node -v: 10.3.0

(paste your output here)

2018-06-01 11 50 34

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22

Commits related to this issue

Most upvoted comments

This woks for me:

rm -rf /usr/local/lib/node_modules
rm -rf /usr/local/bin/node
rm -rf /usr/local/bin/npm
n 10.9.0
node -v
npm -v

n was updated in v2.1.12 to address this issue, which is due to major changes in layout in the npm modules folder. So an important step in addition to fixing npm is to also update n, so the problem does not happen again. For example to fix up broken npm and update n (add sudo if required):

$ rm /usr/local/bin/node
$ rm -rf /usr/local/lib/node_modules/npm
$ n latest
$ npm --version
6.4.1
$ npm install -g n
/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n
+ n@2.1.12
updated 1 package in 0.466s

Use sudo when switching node version with n example sudo n 10.4.1

Had the same issue, reverting to stable, updating npm, then upgrading node to latest worked for me.

See https://github.com/npm/npm/issues/20848#issuecomment-394680906

This woks for me:

rm -rf /usr/local/lib/node_modules
rm -rf /usr/local/bin/node
rm -rf /usr/local/bin/npm
n 10.9.0
node -v
npm -v

Thanks, it worked!

I was actually able to revert back to lts, upgrade n, switch to 10, and then publish.

Thanks!

On Fri, Jun 22, 2018, 7:49 AM Ross Hadden notifications@github.com wrote:

@mateodelnorte https://github.com/mateodelnorte Did you try what @ozjd https://github.com/ozjd linked above? It worked for me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tj/n/issues/508#issuecomment-399431218, or mute the thread https://github.com/notifications/unsubscribe-auth/AAh3X75K-83TTU6d_k3WjVlHo5EYgppfks5t_OeqgaJpZM4UWD6j .

I tried this in a docker container and reproduced the same error. I looked around within npm because this isn’t an N issue. I found these issues: pna.nextTick and this one. I’m going to close this issue but the solution I had was to use node 8.11.2 with npm version 5.6.0 to solve this issue.

@prcongithub That was the solution I was looking for! Thanks, worked in my VM.

Yeah, I’ll make a new release for 2.1.12

– edit: npm shows 2.1.12 but I tagged it on github so you can get the latest @PepperTeasdale