坚持 dalekjs 安装

stuck with dalekjs installation

正在尝试在 Win7 64 位 EE 上安装 dalekjs。 npm 版本 2.15.8。 运行 命令提示符作为管理员。

在 C:\Users\ZW85

下创建了文件 package.json
{
  "name": "myCssTardis",
  "description": "Is awesome",
  "version": "0.0.2"
}

运行 npm install dalek-cli -g

C:\Users\ZW85>npm install dalek-cli -g C:\Users\ZW85\AppData\Roaming\npm\dalek -> C:\Users\ZW85\AppData\Roaming\npm\nod e_modules\dalek-cli\bin\cmd.js dalek-cli@0.0.5 C:\Users\ZW85\AppData\Roaming\npm\node_modules\dalek-cli └── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)

运行 npm install dalekjs --save-dev

C:\Users\ZW85>npm install dalekjs --save-dev npm WARN package.json myCssTardis@0.0.2 No repository field. npm WARN package.json myCssTardis@0.0.2 No README data npm WARN package.json myCssTardis@0.0.2 No license field. npm WARN deprecated lodash@2.4.1: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0. npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select' npm WARN engine node-pngjs@0.0.2: wanted: {"node":"0.8.x"} (current: {"node":"4.4.7","npm":"2.15.8"}) npm WARN deprecated npmconf@2.0.9: this package has been reintegrated into npm and is now out of date with respect to npm npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what' / phantomjs@1.9.12 install C:\Users\ZW85\node_modules\dalekjs\node_modules\dalek-browser-phantomjs\node_modules\phantomjs node install.js

Download already available at C:\Users\ZW85\AppData\Local\Temp\phantomjs\phantomjs-1.9.8-windows.zip Extracting zip contents Removing C:\Users\ZW85\node_modules\dalekjs\node_modules\dalek-browser-phantomjs\node_modules\phantomjs\lib\phantom Copying extracted folder C:\Users\ZW85\AppData\Local\Temp\phantomjs\phantomjs-1.9.8-windows.zip-extract-1471504147493\phantomjs-1.9.8-windows -> C:\Users\ZW85\node_modules\dalekjs\node_modules\dalek-browser-phantomjs\node_modules\phantomjs\lib\phantom

\

不是从这里开始的。试过多次。

也尝试了运行一个测试程序

C:\Users\ZW85>dalek test/*.js

Running tests ERROR: dalek-driver-phantomjs: Binary not found: null

单独安装phantomjs试了一下,还是一样的错误。如果有人能指出我在这里遗漏了什么,那就太好了。

提前致谢!

phantomjs 的路径似乎在 Windows 上太长了。

转到:

   C:\Users\[YOURNAME]\AppData\Local\Temp\phantomjs\phantomjs-1.9.8-windows.zip\

并删除 exmaples 文件夹。重新运行 安装.. 对我有用

我认为这与

是同一个问题

长话短说,确保您的 devDependencies 如下所示:

"devDependencies": { "dalekjs": "0.0.9", "dalek-browser-phantomjs":"https://github.com/wrumsby/dalek-browser-phantomjs/tarball/b0b6c011eec55ea7da987461f6e1c79a6ab4bf6e" }

引用此特定版本的 dalek-browser-phantomjs 应该可以解决挂起问题。

我在 Ubuntu 16 上,这对我有用, 将 package.json 文件更改为

{  
    "name": "myCssTardis",  
    "description": "myTest description",  
    "devDependencies": {  
        "dalekjs": "0.0.9",  
        "dalek-browser-phantomjs":"https://github.com/wrumsby/dalek-browser-phantomjs/tarball/b0b6c011eec55ea7da987461f6e1c79a6ab4bf6e"  
    }  
}

那你就不会面对

ERROR: dalek-driver-phantomjs: Binary not found: null