Code Monkey home page Code Monkey logo

Comments (13)

rstacruz avatar rstacruz commented on June 8, 2024 12

Workaround is to do update the symlinks in ${install_path}/bin to point to the npm-installed one:

# change "8.10.0" to whatever node version you use
cd ~/.asdf/installs/nodejs/8.10.0/bin
ln -nfs ../.npm/bin/npm npm
ln -nfs ../.npm/bin/npx npx

Here's a bash one-liner to do this for all Node.js versions you have installed:

for ver in ~/.asdf/installs/nodejs/*/bin; do cd $ver; if [ -f ../.npm/bin/npm ]; then ln -nfs ../.npm/bin/npm npm; ln -nfs ../.npm/bin/npx npx; fi done

This is not ideal, but it should at least make it work to get you out of possibly-insecure legacy npm versions until #56 is addressed.

from asdf-nodejs.

matchatype avatar matchatype commented on June 8, 2024 4

@psantos10 yep => #56

cd ~/.asdf/installs/nodejs/9.11.1/lib && npm update npm

from asdf-nodejs.

szymon-jez avatar szymon-jez commented on June 8, 2024 3

(I know that this is a very dated issue but somehow I was bitten by this recently in a dated environment and thought to share my experience here)


This is what helped me out:

npm install -g [email protected]
asdf update
asdf plugin-update nodejs
asdf reshim
npm --version
# => 6.1.0

First I had issues like @MOPineyro here #57 (comment) but asdf plugin-update nodejs seemed to do the trick.

from asdf-nodejs.

mareksuscak avatar mareksuscak commented on June 8, 2024

duplicate of #56

from asdf-nodejs.

psantos10 avatar psantos10 commented on June 8, 2024

Hi @Ihackalot

Did you solve this issue?

I am having the same issue here:

$ node -v
v9.11.1
$ npm -v
5.8.0
$ npm i -g npm
npm i -g npm
/Users/psantos/.asdf/installs/nodejs/9.11.1/.npm/bin/npm -> /Users/psantos/.asdf/installs/nodejs/9.11.1/.npm/lib/node_modules/npm/bin/npm-cli.js
/Users/psantos/.asdf/installs/nodejs/9.11.1/.npm/bin/npx -> /Users/psantos/.asdf/installs/nodejs/9.11.1/.npm/lib/node_modules/npm/bin/npx-cli.js
+ [email protected]
updated 1 package in 10.787s
$ asdf reshim nodejs
$ npm -v
5.8.0

I trying to restart the console, the computer and nothing changed. Same issue

from asdf-nodejs.

psantos10 avatar psantos10 commented on June 8, 2024

@Ihackalot unfortunately this tip does not work:

$ npm -v
5.8.0
$ cd ~/.asdf/installs/nodejs/9.11.1/lib && npm update npm
$ asdf reshim nodejs
$ npm -v
5.8.8
$ which node
/Users/psantos/.asdf/shims/node
$ which npm
/Users/psantos/.asdf/shims/npm

Same issue 😞

from asdf-nodejs.

matchatype avatar matchatype commented on June 8, 2024

Which asdf version are you running? Try to asdf update and asdf plugin-update nodejs. It works for me running asdf v0.4.3.

from asdf-nodejs.

psantos10 avatar psantos10 commented on June 8, 2024

asdf and nodejs plugin are updated.

$ asdf --version
0.4.3
$ asdf update
HEAD is now at bcc959f Update version to 0.4.3
Updated asdf to release v0.4.3
$ asdf plugin-update nodejs
Updating nodejs...
Already up to date.
$ npm i -g npm
/Users/psantos/.asdf/installs/nodejs/9.11.1/.npm/bin/npm -> /Users/psantos/.asdf/installs/nodejs/9.11.1/.npm/lib/node_modules/npm/bin/npm-cli.js
/Users/psantos/.asdf/installs/nodejs/9.11.1/.npm/bin/npx -> /Users/psantos/.asdf/installs/nodejs/9.11.1/.npm/lib/node_modules/npm/bin/npx-cli.js
+ [email protected]
updated 1 package in 11.868s
$ asdf reshim nodejs
$ npm -v
5.8.0

Same issue

from asdf-nodejs.

joemsak avatar joemsak commented on June 8, 2024

Coming from #56 (comment) workaround by @rstacruz works for me thanks

from asdf-nodejs.

MOPineyro avatar MOPineyro commented on June 8, 2024

workaround by @rstacruz isn't working for me. Any suggestions as to why?

$ npm i -g npm
/Users/manuelpineyro/.asdf/installs/nodejs/8.11.2/.npm/bin/npm -> /Users/manuelpineyro/.asdf/installs/nodejs/8.11.2/.npm/lib/node_modules/npm/bin/npm-cli.js
/Users/manuelpineyro/.asdf/installs/nodejs/8.11.2/.npm/bin/npx -> /Users/manuelpineyro/.asdf/installs/nodejs/8.11.2/.npm/lib/node_modules/npm/bin/npx-cli.js
+ [email protected]
updated 1 package in 11.44s
$ asdf --version
v0.4.3
$ asdf update
M	defaults
HEAD is now at bcc959f... Update version to 0.4.3
Updated asdf to release v0.4.3
$ asdf plugin-update nodejs
Updating nodejs...
Already up-to-date.
$ npm i -g npm
/Users/manuelpineyro/.asdf/installs/nodejs/8.11.2/.npm/bin/npm -> /Users/manuelpineyro/.asdf/installs/nodejs/8.11.2/.npm/lib/node_modules/npm/bin/npm-cli.js
/Users/manuelpineyro/.asdf/installs/nodejs/8.11.2/.npm/bin/npx -> /Users/manuelpineyro/.asdf/installs/nodejs/8.11.2/.npm/lib/node_modules/npm/bin/npx-cli.js
+ [email protected]
updated 1 package in 11.4s
$ cd ~/.asdf/installs/nodejs/8.11.2/bin
$ ln -nfs ../.npm/bin/npm npm
$ ln -nfs ../.npm/bin/npx npx
$ asdf reshim nodejs
$ npm -v
5.3.0

from asdf-nodejs.

sardaukar avatar sardaukar commented on June 8, 2024

Wasn't working for me either, did an update of asdf and the nodejs plugin and it now works fine in a new shell.

from asdf-nodejs.

Stratus3D avatar Stratus3D commented on June 8, 2024

I believe this has been address under #56 and the related issues.

from asdf-nodejs.

fxsalazar avatar fxsalazar commented on June 8, 2024

Me too: (I know that this is a very dated issue but somehow I was bitten by this recently in a dated environment and thought to share my experience here)

The only thing that helped me was #57 (comment)

Is this something that was fixed?

from asdf-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.