PHANTOMJS明明是有的啊,npm install怎么报错了?
发布于 10 年前 作者 kingapple 20833 次浏览 最后一次编辑是 8 年前

npm install -d .

npm http 404 http://registry.npm.taobao.org/phantomjs/1.9.7 npm ERR! 404 ‘phantomjs’ is not in the npm registry. npm ERR! 404 You should bug the author to publish it npm ERR! 404 It was specified as a dependency of 'Brackets’ npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Windows_NT 6.1.7601 npm ERR! command “C:\Program Files\nodejs\\node.exe” “C:\Program Files\nod ejs\node_modules\npm\bin\npm-cli.js” “install” “-d” "." npm ERR! cwd E:\projects\web\del\brackets npm ERR! node -v v0.10.25 npm ERR! npm -v 1.3.24 npm ERR! code E404 npm ERR!

E:\projects\test>phantomjs phantomjs>

4 回复

应该是npm的时候,没有找到phantomjs npm http 404 http://registry.npm.taobao.org/phantomjs/1.9.7

E:\projects\test>phantomjs phantomjs> 这只是表示你在本机上安装phantomjs了

可以在js这样使用通过spawn来调用phantomjs var phantomjsPath = ‘/opt/phantomjs-1.7.0-macosx/bin/phantomjs’; var rasterizePath = ‘/public/javascripts/rasterize.js"’; var phantomjs = spawn(phantomjsPath, [rasterizePath, ‘http://marshal.easymorse.com’, ‘xxx.jpg’]); phantomjs.on(‘exit’, function (code) { console.log(‘截图成功后,读取图片的二进制数据’); console.log('截图 code: ', code);

当然使用mudel更方便

});

@jiangli373 镜像里为何不放这货:(

回到顶部