简体   繁体   English

npm live-server安装:symlink错误(即使以root / admin身份运行)

[英]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. 我正在使用一本需要安装Node.js的AngularJS教程书(《 解开AngularJS 1.5(IstvánNovák的130多个完整示例 )》 )。 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. 在本书后面的附录中,它列出了命令行代码,以使用NPM安装各种程序包以与Node.js一起使用。 The last component listed is live-server . 列出的最后一个组件是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): 当我尝试安装此组件时,收到以下错误消息(这是从npm-debug.log文件中提取的):

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). 至于最后一行建议以root / admin身份运行-我已经使用root尝试了此操作(我在Ubuntu 16.04 LTS上),但结果不成功(相同的错误代码和所有错误)。 Apparently it's a symlink issue, but I know nothing about those. 显然这是一个符号链接问题,但我对此一无所知。 All other components downloaded via NPM worked just fine. 通过NPM下载的所有其他组件都可以正常工作。

How would one resolve the symlink issue as suggested? 如何按照建议解决符号链接问题?

Please check: 347 error Please try running this command again as root/Administrator. 请检查: 347错误请尝试以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 . 您可以通过命令npm install lite-server -g删除和安装lite-server。 lite-server can install separately. lite-server可以单独安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用npm live-server时是否清除localStorage? - Does the localStorage get cleared when working with npm live-server? 使用 npm 安装 live-server 包时出错。 `npm audit` 无助于解决问题 - Getting error while installing live-server package using npm. `npm audit` is not helping to fix the problem 如何在 VSCode chrome live-server 中运行 npm 模块(puppeteer)? - How to run npm module (puppeteer) in a VSCode chrome live-server? 如何在运行实时服务器的情况下在 Visual Studio Code 中调试 JavaScript - How to Debug JavaScript in Visual Studio Code with live-server Running 是什么导致npm live-server停止检测文件更改? - What would cause npm live-server to stop detecting file changes? 运行 npm install brain.js 时出现奇怪的 npm 错误 - Strange npm error when running npm install brain.js 运行 npm 安装时 ERESOLVE 无法解决错误 - ERESOLVE cound not resolve error when running npm install 即使我以root身份运行,在npm安装过程中权限也被拒绝 - Permission denied during npm install even though I run it as root 关闭和打开应用程序的实时服务器会删除我的本地存储 - closing and opening live-server for an app deletes my local storage yarn eg:'live-server' 不被识别为内部或外部命令 - yarn eg:'live-server' is not recognized as an internal or external command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM