Code Monkey home page Code Monkey logo

Comments (4)

Stratus3D avatar Stratus3D commented on May 29, 2024

I don't regularly use yarn and pnpm so I'm not sure exactly what your issue is. But I do know that in asdf everything is versioned. So if you install something for for NodeJS 11 it's only going to be available in directories that are using NodeJS 11.

Something else you might try is doing something like:

ASDF_NODEJS_VERSION=11.0.0 yarn

See https://github.com/asdf-vm/asdf#set-current-version for more info on those environment variables.

from asdf-nodejs.

mohsenkhanpour avatar mohsenkhanpour commented on May 29, 2024

Thanks, I will test and will let you know.
I was thinking maybe I use curl to install yarn then install pnpm globally from yarn.
I will keep asdf for node version management. Yarn and pnpm are useful for front-end projects with a lot of dependencies.

from asdf-nodejs.

mohsenkhanpour avatar mohsenkhanpour commented on May 29, 2024
root@Mohsen-PC:/mnt/c/Users/Mohsen# export ASDF_NODEJS_VERSION=11.0.0 yarn
root@Mohsen-PC:/mnt/c/Users/Mohsen# npm install -g yarn
/root/.asdf/installs/nodejs/11.0.0/.npm/bin/yarn -> /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/yarn/bin/yarn.js
/root/.asdf/installs/nodejs/11.0.0/.npm/bin/yarnpkg -> /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/yarn/bin/yarn.js
npm WARN lifecycle The node binary used for scripts is /root/.asdf/shims/node but npm is using /root/.asdf/installs/nodejs/11.0.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] postinstall /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/yarn
> /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/.hooks/postinstall
sh: 1: /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/.hooks/postinstall: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] postinstall: `/root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/.hooks/postinstall`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-11-01T14_14_54_335Z-debug.log

However I was able to install yarn via apt-get and then add pnpm globally there.
So now I am using yarn for my global packages and asdf for local installs.

from asdf-nodejs.

mohsenkhanpour avatar mohsenkhanpour commented on May 29, 2024

@Stratus3D I was able to install globally with npm install -g --unsafe-perm=true --allow-root --scripts-prepend-node-path . In my case the problem was that I am using a WSL and it only comes with root user (though you can create more) because the user is already logged in as a Windows user. So because my user was root I had to allow it via npm
And it seems like it is running .hook/postinstall for every package which makes it very slow.

I recommend closing the issues that were resolved with asdf reshim (I took a look some users had said that they were able to resolve with this) and focus on better handling of this postinstall script.

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.