jquery - 在 Ubuntu 14.04 上通过 npm 安装 jsdom 的问题

标签 jquery linux node.js ubuntu jsdom

我尝试安装 jsdom 以在我正在使用的脚本中使用,但是,我经常遇到错误,并且似乎无法在任何地方找到解决方案。大多数人都会遇到没有安装 g++ 的问题,而我已经安装了。

无论如何,这是我的 package.json 文件

{
  "name": "learning_nodejs",
  "version": "0.0.0",
  "description": "",
  "main": "script.js",
  "dependencies": {
    "optimist": "~0.6.1",
    "jquery": "~2.1.3",
    "jsdom": "*"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "BSD-2-Clause"
}

然后,如果之前的尝试中存在该文件,我将删除该文件。进入package.json目录并运行npm install

这似乎工作了一段时间,但后来我遇到了一堆错误。这应该足以说明发生了什么:

npm ERR! error rolling back Error: UNKNOWN, unlink '/home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/node_modules/jsdom/node_modules/cssstyle/lib/properties.js'
npm ERR! error rolling back  <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a9c3dacdc6c4e99d8799879d" rel="noreferrer noopener nofollow">[email protected]</a> { [Error: UNKNOWN, unlink '/home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/node_modules/jsdom/node_modules/cssstyle/lib/properties.js']
npm ERR! error rolling back   errno: -1,
npm ERR! error rolling back   code: 'UNKNOWN',
npm ERR! error rolling back   path: '/home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/node_modules/jsdom/node_modules/cssstyle/lib/properties.js' }
npm ERR! Error: EROFS, symlink '../acorn/bin/acorn'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="630d130e4e23040c0c040f0604110c1613104d000c0e" rel="noreferrer noopener nofollow">[email protected]</a>>

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path ../acorn/bin/acorn
npm ERR! code EROFS
npm ERR! errno 56
npm ERR! Error: ENOENT, lstat '/home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/node_modules/jsdom/node_modules/parse5/lib/tree_construction/doctype.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bfd1cfd292ffd8d0d0d8d3dad8cdd0cacfcc91dcd0d2" rel="noreferrer noopener nofollow">[email protected]</a>>

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/node_modules/jsdom/node_modules/parse5/lib/tree_construction/doctype.js
npm ERR! fstream_path /home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/node_modules/jsdom/node_modules/parse5/lib/tree_construction/doctype.js

...

npm ERR! System Linux 3.13.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/node_modules/jsdom/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test
npm ERR! fstream_path /home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/node_modules/jsdom/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! fstream_finish_call setupMadeDir
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack end (/usr/lib/nodejs/fstream/lib/writer.js:319:21)
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:336:20
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:358:20
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm WARN optional dep failed, continuing <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c8bba7bdbaabade5a5a9b888f8e6f9e6fcfb" rel="noreferrer noopener nofollow">[email protected]</a>
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/daniel/Desktop/virtual_share/javascript_stuff/learning_nodejs/npm-debug.log
npm ERR! not ok code 0

无论如何,我有一种感觉,这与我的投影位于 Ubuntu 14.04(虚拟化)和我的主机操作系统之间安装的共享驱动器有关。

提前致谢

最佳答案

找到解决办法了!

This page is very helpful

基本上,这确实是因为共享文件,但只需添加 --no-bin-links 即可修复它。希望这对某人有帮助!

关于jquery - 在 Ubuntu 14.04 上通过 npm 安装 jsdom 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29180512/

相关文章:

javascript - 引用错误: require is not defined @react

javascript - 无需编辑 MEAN 中的整个条目即可将数据推送到 MongoDB

node.js - 在 digital ocean 水滴上连接我的域名

linux bash inet_ntoa inet_aton

linux - gcc 出现错误 libcpp/charset.c(1747) : error: identifier "saved_error_handler" is undefined

linux - Apache2/httpd (.bashrc) 的特定目录

javascript - jQuery。循环中从ajax获取var

javascript - jQuery UI 小部件工厂 _on 事件返回意外事件目标

jquery - Nodejs Include文件生成前端API

javascript - 简单的 jQuery 模态窗口在页面加载时不显示弹出窗口