WARN [launcher]: PhantomJS have not captured in 60000 ms, killing - node.js

I realize there are other posts regarding this issue but I haven't been able to find anything all day that helps solve my issue, I'm wondering if anyone would know a fix or be able to point me in the right direction based on my specific package versions.
I am running gulp to build my project, when it gets to the karma/karma-coverage.conf.js file it errors out with the warning I noted in the title -> PhantomJS have not captured in 60000 ms, killing..
I'm running NPM v 3.3.7, Node v 6.10.1
My package.json:
{
"engines": {
"node": ">=4.2.4",
"npm": ">=2.1.6"
},
"dependencies": {},
"devDependencies": {
"browser-sync": "1.9.0",
"date-format": "0.0.2",
"del": "1.1.1",
"dgeni": "^0.4.1",
"dgeni-packages": "^0.10.13",
"glob": "^6.0.4",
"gulp": "3.8.10",
"gulp-angular-filesort": "1.0.4",
"gulp-batch": "1.0.4",
"gulp-bump": "0.3.0",
"gulp-concat": "2.4.3",
"gulp-copy": "0.0.2",
"gulp-filelist": "0.1.0",
"gulp-filter": "2.0.0",
"gulp-header": "1.2.2",
"gulp-help": "1.3.1",
"gulp-if": "1.2.5",
"gulp-ignore": "1.2.1",
"gulp-inject": "1.1.1",
"gulp-load-plugins": "0.8.0",
"gulp-minify-css": "^0.4.4",
"gulp-minify-html": "0.1.8",
"gulp-ng-html2js": "0.1.8",
"gulp-rename": "1.2.0",
"gulp-replace": "0.5.2",
"gulp-ruby-sass": "0.7.1",
"gulp-sourcemaps": "1.3.0",
"gulp-strip-debug": "1.0.2",
"gulp-tap": "0.1.3",
"gulp-tslint": "4.3.3",
"gulp-typescript": "2.10.0",
"gulp-uglify": "^1.1.0",
"gulp-useref": "^1.1.2",
"gulp-util": "3.0.2",
"gulp-watch": "^4.1.0",
"gulp-zip": "^3.0.2",
"jshint-stylish": "1.0.0",
"karma": "0.12.25",
"karma-as-promised": "1.0.0",
"karma-chrome-launcher": "0.1.5",
"karma-coverage": "0.2.6",
"karma-firefox-launcher": "0.1.3",
"karma-ie-launcher": "^0.1.5",
"karma-jasmine": "0.2.3",
"karma-junit-reporter": "0.2.2",
"karma-ng-html2js-preprocessor": "0.1.2",
"karma-phantomjs-launcher": "^1.0.0",
"license-collector": "^0.1.1",
"lodash": "^3.7.0",
"main-bower-files": "2.1.0",
"merge-stream": "^1.0.0",
"phantomjs": "1.9.19",
"phantomjs-polyfill": "0.0.1",
"request": "2.53.0",
"require-dir": "0.1.0",
"run-sequence": "1.0.2",
"shelljs": "0.3.0",
"tslint": "3.5.0",
"typedoc": "0.3.12",
"typescript": "1.7.3",
"yargs": "1.3.3"
}
}
My karma-coverage.conf.js
/**
* Run Karma using this configuration file in order to have code coverage
*/
var baseConfig = require('./karma-debug.conf.js');
module.exports = function (config) {
baseConfig(config);
var path = require("path");
var JS_AND_CSS_REGEXP = /(.js|.css)$/i;
// Adds 'coverage' pre-processing on JS files
config.preprocessors['build/debug/components/**/*.js'] = ['coverage'];
// Adds a plugin dependency on karma-coverage
config.plugins.push('karma-coverage');
// Registers reporter
config.reporters.push('coverage');
// Browsers options : PhantomJS, Chrome ...
config.browsers = ['PhantomJS'];
// !!!! : Comment code below if you don't choose PhantomJS Browser : It adds the bind polyfill to phantomJS.
config.files.push({
pattern: 'node_modules/phantomjs-polyfill/bind-polyfill.js',
served: true,
included: true,
watched: false
});
config.autoWatch = false;
config.singleRun = true;
// Configure Reporter
config.coverageReporter = {
reporters: [{type: 'cobertura', dir: 'build/reports/coverage/'}, {type: 'html', dir: 'build/reports/coverage/'}]
}
// override development configuration!
config.browserNoActivityTimeout = 30000;
};
Any help is appreciated!

Please try adding the environment variable
PHANTOMJS_BIN
with value
C:\Program Files\nodejs\phantomjs.cmd
I fell in similar problem and it solved. the value might be different in your installation. (I had to restart my OS, win 10)

Related

Problem with deploying to Google Cloud App Engine

I'm trying to deploy my app to Google Cloud, but I still receive error:
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
> biurovue#1.0.0 start /app
> node build/dev-server.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'chalk' .....
My app is built with nodejs, back end is in Express and Sequalizer and front end is in vuejs.
I'm calling
gcloud int
gcloud app deploy
and then, after few minutes error above occures.
I've tried several times:
npm install chalk
also, I've removed node_modules folder and call npm install from the scratch. Didn't help.
My package.json is following:
{
"name": "biurovue",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "Shark <arek.shark#gmail.com>",
"private": true,
"scripts": {
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js -- single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"
},
"dependencies": {
"#okta/jwt-verifier": "0.0.11",
"axios": "^0.18.0",
"cors": "^2.8.4",
"each-async": "^1.1.1",
"easy-async": "^1.0.0",
"finale-rest": "^1.0.6",
"indent-string": "^4.0.0",
"sequelize": "^4.37.6",
"sqlite3": "^4.1.0",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuedraggable": "^2.23.0"
},
"devDependencies": {
"autoprefixer": "^7.1.5",
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.2",
"babel-plugin-istanbul": "^4.1.5",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"babel-preset-stage-2": "^6.24.1",
"babel-register": "^6.26.0",
"chai": "^4.1.2",
"chalk": "^2.4.2",
"chromedriver": "^2.33.1",
"connect-history-api-fallback": "^1.4.0",
"copy-webpack-plugin": "^4.1.1",
"cross-env": "^5.0.5",
"cross-spawn": "^5.1.0",
"css-loader": "^0.28.7",
"cssnano": "^3.10.0",
"eslint": "^4.9.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-html": "^3.2.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"eventsource-polyfill": "^0.9.6",
"express": "^4.16.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.5",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"http-proxy-middleware": "^0.17.4",
"inject-loader": "^3.0.1",
"karma": "^1.7.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-phantomjs-shim": "^1.5.0",
"karma-sinon-chai": "^1.3.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.31",
"karma-webpack": "^2.0.5",
"mocha": "^4.0.1",
"nightwatch": "^0.9.16",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.3.0",
"phantomjs-prebuilt": "^2.1.15",
"rimraf": "^2.6.2",
"selenium-server": "^3.6.0",
"semver": "^5.4.1",
"shelljs": "^0.7.8",
"sinon": "^4.0.1",
"sinon-chai": "^2.14.0",
"sw-precache-webpack-plugin": "^0.11.4",
"uglify-es": "^3.1.3",
"url-loader": "^0.6.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.3",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.7.1",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-middleware": "^1.12.0",
"webpack-hot-middleware": "^2.19.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
What can be a problem? How to solve? diagnose errors like this?
Thanks.
Move them into dependencies. devDependencies should really only be used, as its name suggests, for development. Suppose you have a package which in turn has multiple dependencies. Suppose you are using mochaJS, chaiJS and sinonJS to achieve full test coverage. The end-user installing your package most likely wouldn't want to install the testing and/or documentation frameworks you used as well. Thus, those frameworks would be placed on devDependencies. In this case, because chalk and shellJS are required at runtime they would have to be placed in dependencies.
Summary: Use dependencies for packages required at runtime and devDependencies for packages required only to develop ( testing frameworks, linting, etc. )

vendor.js is huge after npm run production

I am using Laravue Dashboard based on Laravel and Vue.js, running on an online server, not localhost, it is a fresh install, no edits has been conducted.
My Problem is :
After running npm run watch/dev or even npm run production, vendor.js is about 26MB which I find unreasonably big.
I have tried to run npm run report but nothing shows, no errors or data.
Webpack bundle analyzer plugin is configured but stats.json is empty.
Here are dependencies from package.json:
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"resources/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"devDependencies": {
"#babel/plugin-syntax-dynamic-import": "^7.2.0",
"babel-eslint": "^10.0.2",
"babel-plugin-dynamic-import-node": "^2.3.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"compression-webpack-plugin": "^2.0.0",
"cross-env": "^3.2.3",
"eslint": "^5.16.0",
"eslint-loader": "^2.2.1",
"eslint-plugin-vue": "^5.2.3",
"husky": "^3.0.2",
"laravel-mix": "^4.1.2",
"laravel-mix-eslint": "^0.1.3",
"lint-staged": "^9.2.1",
"resolve-url-loader": "^2.3.1",
"sass-loader": "^7.1.0",
"script-loader": "^0.7.2",
"svg-sprite-loader": "^4.1.3",
"vue-template-compiler": "2.6.10",
"webpack": "^4.39.1",
"webpack-bundle-analyzer": "^3.4.1"
},
"dependencies": {
"axios": "^0.18.1",
"camelcase": "^5.3.1",
"clipboard": "^2.0.4",
"core-js": "^3.1.4",
"driver.js": "^0.9.7",
"dropzone": "^5.5.1",
"echarts": "^4.1.0",
"element-ui": "^2.11.1",
"file-saver": "^2.0.1",
"fuse.js": "^3.4.5",
"js-cookie": "^2.2.0",
"jsonlint": "^1.6.3",
"jszip": "^3.2.2",
"node-sass": "^4.12.0",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"path-to-regexp": "^3.0.0",
"screenfull": "^4.2.1",
"sortablejs": "^1.8.4",
"tui-editor": "^1.4.5",
"vue": "2.6.10",
"vue-count-to": "^1.0.13",
"vue-i18n": "^8.12.0",
"vue-router": "^3.0.7",
"vue-splitpane": "^1.0.4",
"vuedraggable": "^2.23.0",
"vuex": "3.1.0",
"xlsx": "^0.14.4"
}
In the official laravue demo https://laravue.dev/, vendor.js is ~4MB.
I cannot find any reason for this issue, would somebody offer any advise please?
Solved
After hours of inspecting, I found out that " npm run production " wasn't finishing because of memory shortage, this is why no errors were returned, the process was killed at some point with no messages.
simply restarted server and re-ran command.. Worked like magic.
May be if you remove some package that is not needed, will reduce vendor file size more.

After installing graphql-tools and graphql-express. Error message in console 'Cannot find name 'AsyncIterator'

Error Log On initiating application
While initiating the application it shows the following error and i tried couple of fixes from online which has mentioned below but none of them has worked requesting for suggestions and solutions
node_modules/#types/graphql/subscription/subscribe.d.ts(17,12): error TS2304: Cannot find name 'AsyncIterator'.
node_modules/#types/graphql/subscription/subscribe.d.ts(29,12): error TS2304: Cannot find name 'AsyncIterable'.
node_modules/graphql-tools/dist/stitching/makeRemoteExecutableSchema.d.ts(3,109): error TS2304: Cannot find name 'AsyncIterator'.
Fixes Tried as per google results
Adding esnext.asynciterable to the tsconfig.json
Adding esnext to the tsconfig.json
But none of them has worked.
package.json
"dependencies": {
"async": "^2.6.0",
"body-parser": "^1.18.2",
"cookie-parser": "^1.4.3",
"cors": "^2.8.4",
"ejs": "^2.5.7",
"errorhandler": "^1.5.0",
"express": "^4.16.2",
"express-graphql": "^0.6.12",
"graphql": "^0.13.2",
"graphql-tools": "^3.1.1",
"ldapjs": "^1.0.1",
"method-override": "^2.3.10",
"moment": "^2.20.1",
"mongoose": "^4.13.6",
"morgan": "^1.9.0",
"mysql": "^2.15.0",
"node-schedule": "^1.3.0",
"nodemiral": "^1.1.1",
"pug": "^2.0.0-rc.4",
"q": "^1.5.1",
"request": "^2.85.0",
"sendmail": "^1.2.0",
"serve-favicon": "^2.4.5",
"socket.io": "^2.0.4",
"ts-node": "^3.3.0"
},
"devDependencies": {
"#types/async": "^2.0.47",
"#types/body-parser": "^1.16.8",
"#types/chai": "^4.0.8",
"#types/chai-http": "^3.0.3",
"#types/cookie-parser": "^1.4.1",
"#types/cors": "^2.8.3",
"#types/errorhandler": "0.0.32",
"#types/ldapjs": "^1.0.3",
"#types/lodash": "^4.14.106",
"#types/method-override": "0.0.31",
"#types/mocha": "^2.2.44",
"#types/mongodb": "^2.2.16",
"#types/mongoose": "^4.7.28",
"#types/morgan": "^1.7.35",
"#types/mysql": "^2.15.3",
"#types/node-schedule": "^1.2.2",
"#types/request": "^2.47.0",
"#types/serve-favicon": "^2.2.30",
"#types/socket.io": "^1.4.32",
"chai": "^4.1.2",
"chai-http": "^3.0.0",
"grunt": "^1.0.1",
"grunt-concurrent": "^2.3.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-mocha-test": "^0.13.3",
"grunt-newer": "^1.3.0",
"grunt-nodemon": "^0.4.2",
"grunt-ts": "^6.0.0-beta.17",
"grunt-tslint": "^5.0.1",
"grunt-typedoc": "^0.2.4",
"mocha": "^4.0.1",
"mocha-typescript": "^1.1.12",
"nodemon": "^1.12.4",
"tslint": "^5.8.0",
"typescript": "^2.6.2"
}
Delete node modules then:-
npm install
npm install --save graphql-subscriptions
npm install --save #types/graphql
npm install --save #types/ws
add the following in tsconfig.json
"compilerOptions": {
"lib": [
"esnext.asynciterable"
]
I encountered the same problem and adding
"lib": ["es2017", "esnext", "esnext.asynciterable"]
to my tsconfig.json did not help, which was frustrating.
I went through lots of suggestions and eventually the answer by Shivendra solved it for me. Hope this will help others coming here in the future.

node-gyp windows 7 Enterprise reactjs/flux

So my issues are mostly the same as posts from here. It starts to explain all the issues and steps needed for windows users and node-gyp problems.
As I am sure you can imagine, I ran into the same problems as everyone else on windows trying to run 'npm install'. The culprit is node-gyp. I followed ToTallNate's solution step by step multiple times and still can't get node-gyp to do a rebuild. I have uninstalled and reinstalled everything in the correct order only God know's how many times. My Python is the correct V and is in my PATH as well as node. I've tried on VS2010 and 2015 express with no luck. I am preparing to restore my image to day one and start over again with the installs (it's a new desktop we just started working on so no big losses here)
To give you a quick background My client handed me a stack of Reactjs components that were developed on os x and linux and is pretty much forcing me to use this stack on a windows environment because it uses a tech stack approved for use by this company. The dev team I am working with is all on windows 7 enterprise
My questions are:
How many npm modules/packages depend on node-gyp? And just what is node-gyp doing for them? can someone please elaborate/point me in the right direction. I've seen the npm documentation a million times so that won't help me right now...
Is there a better set of modules I should be using with windows from npm?
Can anyone recommend a better way to get started with a reactjs/flux project on windows? Would grunt work better than gulp?
I'm relatively new to working with this frontend stack so thank you for your patience.
Here is the package.json they want me to work with:
`"config": {
"server_port": "4040",
"browser_sync_port": "8080",
"livereload_port": "35729"
},
"scripts": {
"start": "gulp",
"build": "gulp build --prod",
"test": "./node_modules/karma/bin/karma start karma.conf.js",
"ci-test": "./scripts/ci-test.sh"
},
"devDependencies": {
"aliasify": "^1.4.0",
"async": "^0.9.0",
"axios": "^0.5.4",
"body-parser": "^1.9.2",
"browser-sync": "^1.3.7",
"browserify": "5.10.0",
"chai": "^1.9.1",
"component-mocker": "^0.2.0",
"compression": "^1.0.11",
"connect-livereload": "0.4.0",
"envify": "~3.0.0",
"express": "~4.8.5",
"falafel": "^0.3.1",
"glob": "^4.0.5",
"gulp": "~3.8.7",
"gulp-arialinter": "0.0.1",
"gulp-autoprefixer": "^2.0.0",
"gulp-concat": "^2.4.3",
"gulp-if": "^1.2.1",
"gulp-jshint": "~1.8.4",
"gulp-livereload": "2.1.0",
"gulp-nodemon": "^2.0.2",
"gulp-notify": "^1.4.0",
"gulp-react": "^2.0.0",
"gulp-sass": "^1.3.3",
"gulp-scss-lint": "^0.1.4",
"gulp-shell": "~0.2.9",
"gulp-streamify": "0.0.5",
"gulp-strip-line": "0.0.1",
"gulp-tar": "^1.3.2",
"gulp-template": "^3.0.0",
"gulp-uglify": "~0.3.0",
"gulp-util": "^3.0.0",
"gulp-watch": "~0.6.9",
"jshint-stylish": "~0.4.0",
"karma": "^0.12.21",
"karma-bro": "^0.7.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^0.1.4",
"karma-coverage": "^0.2.6",
"karma-firefox-launcher": "^0.1.3",
"karma-mocha": "^0.1.9",
"karma-phantomjs-launcher": "^0.1.4",
"karma-safari-launcher": "^0.1.1",
"karma-spec-reporter": "0.0.13",
"merge-stream": "~0.1.5",
"messageformat": "~0.2.1",
"mkdirp": "~0.5.0",
"mocha": "^1.21.4",
"nopt": "^3.0.1",
"react-tools": "^0.12.0",
"reactify": "^0.15.2",
"request": "^2.47.0",
"requirefrom": "~0.2.0",
"rewireify": "~0.0.9",
"rimraf": "~2.2.8",
"run-sequence": "~0.3.6",
"sinon": "^1.10.3",
"sinon-chai": "^2.5.0",
"s-ui-build": "0.1.14",
"s-ui-icon": "^0.1.9",
"through": "~2.3.4",
"vinyl-source-stream": "^0.1.1",
"watchify": "^1.0.2"
},
"dependencies": {
"accounting": "^0.4.1",
"classnames": "^1.1.4",
"console-shim": "^1.0.3",
"es5-shim": "^4.0.1",
"inherits": "^2.0.1",
"jquery": "~1.11.1",
"lodash": "~2.4.1",
"moment": "2.7.0",
"react": "~0.12.0",
"react-router": "~0.11.6",
"uuid": "^2.0.1"
},
"aliasify": {
"aliases": {}
}
}
`

Node module generating a lot of subfolders

I'm running my build on jenkins but when I run npm install --color=false --loglevel warn it generate a lot of subfolders, and I can't even delete them on windows (I have to rename them before that).
It has started to happen today, we didin't manually update anything
My packages.json file
{
"name": "contratanet-portal",
"version": "0.1.0",
"description": "Builder do contratanet portal",
"private": true,
"devDependencies": {
"grunt": "~0.4.5",
"grunt-shell": "~0.7.0",
"grunt-msbuild": "~0.1.12",
"grunt-nuget": "~0.1.3",
"underscore": "~1.6.0",
"karma": "^0.12.23",
"karma-jasmine": "^0.1.5",
"requirejs": "^2.1.15",
"karma-chrome-launcher": "^0.1.4",
"karma-firefox-launcher": "^0.1.3",
"lodash": "^2.4.1",
"karma-opera-launcher": "^0.1.0",
"karma-safari-launcher": "^0.1.1",
"karma-ie-launcher": "^0.1.5",
"karma-junit-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^0.1.4",
"grunt-karma": "^0.9.0"
}
}

Resources