首页 > 解决方案 > 在 Ubuntu 16.04 上安装 npm 的问题

问题描述

我正在尝试使用以下命令安装 babel:

npm install --save-dev babel-cli

这是抛出以下输出。

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.3
npm WARN react-essential@1.0.0 No repository field.
npm ERR! Linux 4.4.0-122-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save-dev" "babel-cli"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! path ../babel-cli/bin/babel-doctor.js
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink

npm ERR! EPROTO: protocol error, symlink '../babel-cli/bin/babel-doctor.js' -> '/code/ReactExampleFiles/Ch02/02_01/start/node_modules/.bin/babel-doctor'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 4.4.0-122-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save-dev" "babel-cli"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! path npm-debug.log.1893237937
npm ERR! code ETXTBSY
npm ERR! errno -26
npm ERR! syscall rename

npm ERR! ETXTBSY: text file is busy, rename 'npm-debug.log.1893237937' -> 'npm-debug.log'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /code/ReactExampleFiles/Ch02/02_01/start/npm-debug.log

在一些研究中 - 建议尝试npm install --no-bin-links,但仍然出错:

vagrant@ubuntu-xenial:/code/ReactExampleFiles/Ch02/02_01/start$ npm install --no-bin-links
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.3
npm WARN react-essential@1.0.0 No repository field.

请建议如何解决。

标签: node.jsubuntunpmvagrantnpm-install

解决方案


尝试更新版本的 npm。npm install npm -g 或 apt update npm。


推荐阅读