Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run preinstall in authorize-idp #140

Open
DinoChiesa opened this issue Mar 2, 2024 · 1 comment
Open

npm run preinstall in authorize-idp #140

DinoChiesa opened this issue Mar 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@DinoChiesa
Copy link
Contributor

Description

Running npm install or npm run preinstall leads to a permissions error.

To Reproduce

  1. Run

    npm install
    

    or

    npm run preinstall
    
  2. See error

    $ npm run preinstall
    
    > [email protected] preinstall
    > npm list [email protected] -g || npm install [email protected] -g
    
    /usr/local/lib
    └── (empty)
    
    npm ERR! code EACCES
    npm ERR! syscall symlink
    npm ERR! path ../lib/node_modules/pem-jwk/bin/pem-jwk.js
    npm ERR! dest /usr/local/bin/pem-jwk
    npm ERR! errno -13
    npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/pem-jwk/bin/pem-jwk.js' -> '/usr/local/bin/pem-jwk'
    npm ERR!  [Error: EACCES: permission denied, symlink '../lib/node_modules/pem-jwk/bin/pem-jwk.js' -> '/usr/local/bin/pem-jwk'] {
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'symlink',
    npm ERR!   path: '../lib/node_modules/pem-jwk/bin/pem-jwk.js',
    npm ERR!   dest: '/usr/local/bin/pem-jwk'
    npm ERR! }
    npm ERR! 
    npm ERR! The operation was rejected by your operating system.
    npm ERR! It is likely you do not have the permissions to access this file as the current user
    npm ERR! 
    npm ERR! If you believe this might be a permissions issue, please double-check the
    npm ERR! permissions of the file and its containing directories, or try running
    npm ERR! the command again as root/Administrator.
    
    npm ERR! A complete log of this run can be found in: /Users/dchiesa/.npm/_logs/2024-03-02T01_44_13_832Z-debug-0.log
    

Additional Context

I ran this on MacOS with

$ npm --version
9.8.1

Expected behavior

install or preinstall should work. In fact there is no need to require global installation of the pem-jwk module.
The script that uses the module (deploy-authorize-idp-access-tokens.sh ) can easily reference it from node_modules.

@DinoChiesa DinoChiesa added the bug Something isn't working label Mar 2, 2024
@ssvaidyanathan
Copy link
Collaborator

ssvaidyanathan commented Mar 2, 2024

have to run as sudo

sudo npm install as the preinstall script is installing the module globally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants