How to find out which dependencies drives the installation of phantomjs-prebuilt?
When I run npm install
for my project on my mac book pro, I saw this output
> phantomjs-prebuilt@2.1.16 install /Users/antkong/dev/my_project/node_modules/phantomjs-prebuilt
> node install.js
PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-macosx.zip
Saving to /var/folders/d_/y12s1m0j49vff0hf_b1lzgdr0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip
Receiving...
[========================================] 100%
Received 16746K total.
Extracting zip contents
Removing /Users/antkong/my_project/webview/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /var/folders/d_/y12s1m0j49vff0hf_b1lzgdr0000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1573703277110/phantomjs-2.1.1-macosx -> /Users/antkong/dev/my_project/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /Users/antkong/dev/my_project/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
My first problem is: I cannot determine which dependency trigger the download of this version of phantomjs.
Here is the list of dependency of my package.json
"devDependencies": {
"autoprefixer": "^6.3.6",
"coffee-script": "^1.10.0",
"fs-extra": "~0.19.0",
"grunt": "^0.4.5",
"grunt-bump": "0.0.13",
"grunt-coffeelint": "0.0.15",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-coffee": "1.0.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-less": "~0.11.0",
"grunt-contrib-requirejs": "~0.4.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-mkdir": "~0.1.2",
"grunt-mocha": "1.0.2",
"grunt-modernizr": "^0.5.2",
"grunt-postcss": "^0.8.0",
"grunt-shell": "^1.1.2",
"grunt-webfont": "^1.6.0",
"husky": "^0.14.3",
"lint-staged": "^7.1.2",
"prettier": "1.13.4",
"underscore": "~1.7.0"
},
The real issue that is causing me grief is this: when I tried to run the same npm install
on our CI service, which uses Linux docker, npm
downloaded the version 2.1.16 of phantomjs. I want to know which dependency is causing this discrepancy.
See also questions close to this topic
-
Lumen with node and with browserSync crash on start
I have to run PHP server and proxy it with browserSync but when I serve it by node I got issues:
This is the console log:
[23:25:56] Starting 'serve'... [23:25:56] Starting 'clean'... [23:25:56] Finished 'clean' after 31 ms [23:25:56] Starting 'image'... [23:25:56] Starting 'webpack'... [23:25:57] Version: webpack 1.15.0 Asset Size Chunks Chunk Names site.js 5.71 kB 0 [emitted] site site-gallery.js 3.75 kB 1 [emitted] site-gallery site-home.js 11.2 kB 2 [emitted] site-home .... several 404 .... [23:25:57] Finished 'webpack' after 810 ms [23:26:00] gulp-imagemin: Minified 175 images (saved 9.26 MB - 47.2%) [23:26:00] Finished 'image' after 3.68 s [23:26:00] Starting 'server'... PHP 7.1.28 Development Server started at Sat Dec 14 23:26:01 2019 Listening on http://127.0.0.1:8888 Document root is ******/public Press Ctrl-C to quit. [Sat Dec 14 23:26:01 2019] 127.0.0.1:51385 [200]: / [23:26:01] 'server' errored after 1.53 s [23:26:01] Error: no parsers registered for: "]a(r)" ..../node_modules/snapdragon/lib/parser.js:473:15) [23:26:01] 'serve' errored after 5.25 s npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! server@1.0.0 serve: `gulp serve` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the server@1.0.0 serve script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/uncoke/.npm/_logs/2019-12-14T22_26_01_845Z-debug.log
gulpfile.js
... gulp.task('server', function() { $.connectPhp.server({ base: pkg.directories.dist, port: '8888' }, function() { browserSync({ proxy: 'localhost:8888', port: '3000' }) })
Now if I open the browser at http://localhost:8888/ I see the server up and running and in console .log it appears the log.
Note: Just a second before to crash the script open a window on browser at then it crash
What's wrong?
-
Webpack error: TypeError: chunk.hasRuntime is not a function
I have an old corrupted package.json and I'm trying to fix it. It was using webpack 1.13 and I updated to webpack@2. Now I'm checking the other dependencies to be updated but wen I tra to serve I got some errors.
Can you help me to fix it? At moment I don't need to update to latest versions but I just need to run the server.
I got this error when I start my server:
TypeError: chunk.hasRuntime is not a function
Here my packages:
"devDependencies": { "autoprefixer": "^6.5.3", "browser-sync": "^2.17.6", "css-loader": "^0.26.1", "del": "^2.2.2", "eslint": "^3.10.0", "eslint-config-standard": "^6.2.1", "eslint-plugin-promise": "^3.3.2", "eslint-plugin-standard": "^2.0.1", "exports-loader": "^0.6.3", "expose-loader": "^0.7.1", "extract-text-webpack-plugin": "^2.1.2", "file-loader": "^0.9.0", "gulp": "^4.0.2", "gulp-connect-php": "0.0.8", "gulp-exec": "^2.1.3", "gulp-imagemin": "^3.1.1", "gulp-load-plugins": "^1.4.0", "gulp-shell": "^0.5.2", "gulp-webpack": "^1.5.0", "img-loader": "^1.3.1", "imports-loader": "^0.7.0", "node-sass": "^4.3.0", "postcss-loader": "^1.1.1", "sass-loader": "^4.0.2", "script-loader": "^0.7.0", "style-loader": "^0.13.1", "url-loader": "^0.5.7", "vinyl-named": "^1.1.0", "webpack": "^2.7.0", "webpack-dev-server": "^2.11.5", "yargs": "^6.4.0" },
webpack.config.dev.js
var pkg = require('./package.json') var path = require('path') var webpack = require('webpack') var autoprefixer = require('autoprefixer') var ExtractCss = require('extract-text-webpack-plugin') var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin var DedupePlugin = webpack.optimize.DedupePlugin var ProvidePlugin = webpack.ProvidePlugin module.exports = { output: { publicPath: '/assets/js/', filename: '[name].js', chunkFilename: 'chunks/[id]-[hash].js' }, resolve: { alias: { 'plugins': path.resolve(__dirname, pkg.directories.src, 'plugins'), 'assets': path.resolve(__dirname, pkg.directories.src, 'assets'), 'jquery': 'plugins/jquery/js/jquery' } }, amd: {}, module: { loaders: [{ test: /\.css$/i, loaders: ExtractCss.extract({fallback: 'style', use: 'css'}) }, { test: /\.scss$/i, loaders: ExtractCss.extract({fallback: 'style', use: 'css'}) }, { test: /\.(jpg|jpeg|png|gif|cur|ico)(?:\?.*|)$/, loader: 'file?name=../img/[name].[ext]' }, { test: /\.(woff|woff2|eot|ttf|svg)(?:\?.*|)$/, loader: 'file?name=../fonts/[name].[ext]' }] }, plugins: [ new ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', 'window.$': 'jquery' }), new ExtractCss('../css/[name].css'), new CommonsChunkPlugin({ name: 'vendor', filename: 'vendor.js' }), new DedupePlugin() ], devServer: {}, postcss: [ autoprefixer({ browsers: [ 'Chrome >= 35', 'Firefox >= 38', 'Edge >= 12', 'Explorer >= 9', 'iOS >= 8', 'Safari >= 8', 'Android 2.3', 'Android >= 4', 'Opera >= 12' ] }) ] }
-
Unable to deploy application on heroku
I am receiving the following error while deploying my application on heroku, I have deployed it before with no problems. I also have not changed the package.json file, so I am unsure why I am getting the following error.
There are no additional configs for heroku, the application was previously deployed, and cannot be updated.
The application is deployed currently under a previous version through the heroku website from my github.
Any help to resolve this issue would be greatly appreciated!
error from heroku
-----> Build Running heroku-postbuild > operations-reporting@1.0.0 heroku-postbuild /tmp/build_04594e22478b41fb98f830b9b12c2400 > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client added 86 packages from 287 contributors and audited 906755 packages in 16.658s found 2 moderate severity vulnerabilities run `npm audit fix` to fix them, or `npm audit` for details > client@0.1.0 build /tmp/build_04594e22478b41fb98f830b9b12c2400/client > react-scripts build internal/modules/cjs/loader.js:800 throw err; ^ Error: Cannot find module 'es-abstract/2019/CreateDataProperty' Require stack: - /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js - /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/index.js - /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/implementation.js - /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/index.js - /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/html-webpack-plugin/index.js - /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/config/webpack.config.js - /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/scripts/build.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15) at Function.Module._load (internal/modules/cjs/loader.js:690:27) at Module.require (internal/modules/cjs/loader.js:852:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.<anonymous> (/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js:3:26) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14) at Module.require (internal/modules/cjs/loader.js:852:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js', '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/index.js', '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/implementation.js', '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/index.js', '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/html-webpack-plugin/index.js', '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/config/webpack.config.js', '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/scripts/build.js' ] } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! client@0.1.0 build: `react-scripts build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the client@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /tmp/npmcache.PQkmQ/_logs/2019-12-14T21_42_39_533Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! operations-reporting@1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the operations-reporting@1.0.0 heroku-postbuild script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /tmp/npmcache.PQkmQ/_logs/2019-12-14T21_42_39_547Z-debug.log -----> Build failed We're sorry this build is failing! You can troubleshoot common issues here: https://devcenter.heroku.com/articles/troubleshooting-node-deploys Some possible problems: - node_modules checked into source control https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits - Node version not specified in package.json https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version Love, Heroku ! Push rejected, failed to compile Node.js app. ! Push failed
package.json
{ "name": "client", "version": "0.1.0", "main": "index.js", "private": true, "dependencies": { "axios": "^0.19.0", "config": "^3.2.4", "express": "^4.17.1", "express-validator": "^6.3.0", "formik": "^2.0.6", "mongoose": "^5.7.12", "react": "^16.12.0", "react-dom": "^16.12.0", "react-router-dom": "^5.1.2", "react-scripts": "3.2.0", "react-table": "^6.10.3", "reactstrap": "^8.1.1", "schema-utils": "^2.6.1" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": "react-app" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "devDependencies": { "concurrently": "^5.0.0", "nodemon": "^2.0.1" }, "proxy": "http://localhost:5000" }
-
Which is better - PhantomJS or Selenium with Firefox
Which tool is better for automating web page interaction. There are some blogs stating currently PhantomJS has been discontinued. But some still uses it.
-
get page source from one website - none of the options doesnt work
I want to get the page source of one web page. I tried with PHP curl, proxies, Luminati, phantomjs, and then I founded a solution with python selenium and chromedriver, but now that option also doesn't work
:
<html><head>\n<title>Access Denied</title>\n</head><body>\n<h1>Access Denied</h1>\n \nYou don\'t have permission to access this website.
Does someone have ides what else I can try to get the page source?
-
PhantomJS 2.5 Beta not parsing TikTok Page
Hello I am trying to parse a simple page from tiktok.com and phantom JS is printing weird things. Below is my code of
script.js
var webPage = require('webpage'); var page = webPage.create(); var system = require('system'); var args = system.args; var url = 'https://www.tiktok.com/@timebucks'; //console.log(page); try { console.log('opening page'); page.settings.userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36'; page.open(url, function (status) { console.log('opening'); if (status !== 'success') { //phantom.exit(); } else { console.log(page); console.log(page.content); //phantom.exit(); } }); } catch (ex) { var fullMessage = "\nJAVASCRIPT EXCEPTION"; fullMessage += "\nMESSAGE: " + ex.toString(); for (var p in ex) { fullMessage += "\n" + p.toUpperCase() + ": " + ex[p]; } console.log('catch error'); console.log(fullMessage); } page.onInitialized = function () { console.log('initialized'); //if (page.injectJs('node_modules/babel-polyfill/dist/polyfill.js')) { } //if (page.injectJs('node_modules/promise-polyfill/dist/polyfill.js')) { } } page.onError = function (msg, trace) { var msgStack = ['ERROR: ' + msg]; if (trace && trace.length) { msgStack.push('TRACE:'); trace.forEach(function (t) { msgStack.push(' -> ' + t.file + ': ' + t.line + (t.function ? ' (in function "' + t.function + '")' : '')); }); } // uncomment to log into the console console.log('error'); console.log(msgStack.join('\n')); };
Command line i am using to run phantomjs.exe
phantomjs.exe script.js
This is what its printing
Any help or clue whats going on?