简体   繁体   中英

npm live-server install: symlink error (even when running as root/admin)

I'm working with an AngularJS tutorial book ( Unraveling AngularJS 1.5 (With Over 130 Complete Samples by István Novák) ) which requires Node.js to be installed. In the appendix in the back of the book, it lists command line codes to install various packages to work with Node.js, using NPM. The last component listed is live-server . I am running the following commands:

npm init -y
npm install angular@^1.5.0 --save
npm install angular-messages@^1.5.0 --save
npm install angular-route@1.5.0-beta.2 --save
npm install bootstrap --save
npm install jquery --save
npm install live-server --save-dev 

Everything worked just fine except for live-server. When I try to install this component, I get the following error messages (this is pulled from the npm-debug.log file):

335 warn UnravelingAngular1.5@1.0.0 No repository field.
336 verbose stack Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/media/usb/AngularJS Test/Samples/node_modules/.bin/mime'
336 verbose stack     at Error (native)
337 verbose cwd /media/usb/AngularJS Test/Samples
338 error Linux 4.4.0-31-generic
339 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "live-server" "--save-dev"
340 error node v4.4.7
341 error npm  v3.10.5
342 error path ../mime/cli.js
343 error code EPERM
344 error errno -1
345 error syscall symlink
346 error Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/media/usb/AngularJS Test/Samples/node_modules/.bin/mime'
346 error     at Error (native)
346 error  { [Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/media/usb/AngularJS Test/Samples/node_modules/.bin/mime']
346 error   errno: -1,
346 error   code: 'EPERM',
346 error   syscall: 'symlink',
346 error   path: '../mime/cli.js',
346 error   dest: '/media/usb/AngularJS Test/Samples/node_modules/.bin/mime',
346 error   parent: 'UnravelingAngular1.5' }
347 error Please try running this command again as root/Administrator.
348 verbose exit [ -1, true ]

As to the line at the end suggesting running as root/admin -- I've tried this using root (I'm on Ubuntu 16.04 LTS), with the same unsuccessful result (same error codes and everything). Apparently it's a symlink issue, but I know nothing about those. All other components downloaded via NPM worked just fine.

How would one resolve the symlink issue as suggested?

Please check: 347 error Please try running this command again as root/Administrator. If not, you should try to check compatible node module version. You can remove and install lite-server by command npm install lite-server -g . lite-server can install separately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM