Phantomjs + webpack not working

npm i -g phantom

/

weak@0.4.1 install C: \ Users \ muzo0 \ AppData \ Roaming \ npm \ node_modules \ phantom \ node_modules \ dnode \ node_modules \ weak node-gyp rebuild

C: \ Users \ muzo0 \ AppData \ Roaming \ npm \ node_modules \ phantom \ node_modules \ dnode \ node_modules \ weak> if npm_config_n ode_gyp is not defined (node ​​"C: \ DevLibs \ nodejs \ node_modules \ npm \ bin \ node-gyp- bin \ .... \ node_modules \ node-gyp \ bin \ node-gyp.js "rebuild) else (rebuild) Build projects in this solution on time. To enable parallel build, add the "/ m" switch.
weakref.cc Create library C: \ Users \ muzo0 \ AppData \ Roaming \ npm \ node_modules \ phantom \ node_modules \ dnode \ node_modules \ weak \ buil d \ Release \ weakref.lib and object C: \ Users \ muzo0 \ AppData \ Roaming \ Nap \ node_modules \ phantom \ node_modules \ dnode \ node_modu les \ weak \ build \ Release \ weakref.exp Generate code Finished generating code weakref.vcxproj β†’ C: \ Users \ muzo0 \ AppData \ Roaming \ npm \ node_modules \ phantom \ node_modules \ dnode \ node_modules \ weak \ builds \ Release \ weakref.node phantom @ 0.7.2 C: \ Users \ muzo0 \ AppData \ Roaming \ npm \ node_modules \ phantom β”œβ”€β”€ win-spawn@2.0.0 β”œβ”€β”€ traverse @ 0.6.6 β”œβ”€β”€ shoe@0.0.15 ( sockjs@0.3.7 ) └── dnode@1.2.1 ( jsonify@0.0.0 , dnode-protocol@0.2.2 ,weak@0.4.1 )

webpack.config.js

module.exports = {
    entry: './src/main.js',
    output: {
        filename: 'dist.js'
    },
    module: {
        loaders: [
            { test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
            { test: /\.json$/, loader: 'json'}
        ]
    },
    target: "node"
};

      

webpack -hot

Hash: d94ab9a8045078efe92c Version: webpack 1.10.0 Time: 2807ms Asset
Size Chunks Chunk Names dist.js 1.28 MB
0 [emitted] main + 180 hidden modules

WARNING. / ~ / Phantom / ~ / dnode / ~ / weak / ~ / bindings / bindings.js Critical dependency: 76: 22-40 dependency request - expression 76: 43-53 dependency request is an @ expression. / ~ / phantom / ~ / dnode / ~ / weak / ~ / bindings / bindings.js 76: 22-40 76: 43-53

WARNING. / ~ / Phantom / ~ / shoe / ~ / sockjs / lib / utils.js Module not found: Error: Unable to resolve module "rbytes" in C: \ Users \ muzo0 \ Desktop \ new_tele_bot \ node_modules \ phantom \ node_modules \ shoe \ node_modules \ sockjs \ lib @. / ~ / phantom / ~ / shoe / ~ / sockjs / lib / utils.js 7: 13-30

ATTENTION c. / ~ / phantom / ~ / dnode / ~ / weak / ~ / bindings / README.md module parse failed: C: \ Users \ muzo0 \ Desktop \ new_tele_bot \ node_modules \ phantom \ node_modules \ dnode \ node_modules \ weak \ node_ modules \ bindings \ README.md Line 2: Unexpected token === You may need an appropriate loader to handle this type of file. | node-binding | ============== | ### Helper module for loading your own .node file. @. / ~ / phantom / ~ / dnode / ~ / weak / ~ / bindings ^. /. * $

node dest.js

module.js: 338 throw error; ^ Error: Cannot find module 'c: \ Users \ muzo0 \ Desktop \ new_tele_bot \ dest.js' in Function.Module._resolveFilename (module.js: 336: 15) in Function.Module._load (module.js: 278 : 25) in Function.Module.runMain (module.js: 501: 10) when running (node.js: 129: 16) on node.js: 814: 3

C: \ Users \ muzo0 \ Desktop \ new_tele_bot> phantomjs

'phantomjs' is not recognized as an internal or external command, runtime program, or batch file.

main.js

import phantom from 'phantom';

      

OS: win 10 npm: 2.7.4

+3


source to share





All Articles