0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Setup npm

Last updated at Posted at 2021-07-16

If you want to use global path with npm, not local.

1. Install npm 2. `npm install -g {modules}` - Sometimes it gets permission error
-> Comfirm path with `npm -g list`
-> change the permission of the directory 

WARNING: If the displayed path is just /usr, switch to Option 2 or you will mess up your permissions.
-> sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

  1. try to run the module
    {module} --version

    • when it gets an error {module} command not found

    try to run:
    export PATH=(npm config get prefix)/{lib/node_modules,bin,share}:$PATH > ~/.profile
    source ~/.profile
    Make sure there is a path in .profile

It will work.

Referrence

https://superuser.com/questions/1081769/after-npm-install-g-command-still-not-found
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?