在Ubuntu 16.04上安装npm的问题

时间:2018-05-01 09:23:41

标签: node.js ubuntu npm vagrant npm-install

我正在尝试使用以下命令安装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.

请建议如何解决。

1 个答案:

答案 0 :(得分:0)

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