Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
827 views
in Technique[技术] by (71.8m points)

permissions - npm static-server package on Ubuntu

When I try to install the static-server package using npm -g install static-server, I get these errors:

  npm ERR! code EACCES
    npm ERR! syscall symlink
    npm ERR! path ../lib/node_modules/static-server/bin/static-server.js
    npm ERR! dest /usr/local/bin/static-server
    npm ERR! errno -13
    npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/static-server/bin/static-server.js' -> '/usr/local/bin/static-server'
    npm ERR!  [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/static-server/bin/static-server.js' -> '/usr/local/bin/static-server'] {
    npm ERR!   cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/static-server/bin/static-server.js' -> '/usr/local/bin/static-server'] {
    npm ERR!     errno: -13,
    npm ERR!     code: 'EACCES',
    npm ERR!     syscall: 'symlink',
    npm ERR!     path: '../lib/node_modules/static-server/bin/static-server.js',
    npm ERR!     dest: '/usr/local/bin/static-server'
    npm ERR!   },
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'symlink',
    npm ERR!   path: '../lib/node_modules/static-server/bin/static-server.js',
    npm ERR!   dest: '/usr/local/bin/static-server'
    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:
npm ERR!     /home/rosen/.npm/_logs/2021-02-05T05_17_31_402Z-debug.log

What should I do next? Thank you very much!

question from:https://stackoverflow.com/questions/66057972/npm-static-server-package-on-ubuntu

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...