Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to run grunt-lib-phantomjs on windows #59

Closed
Markavian opened this issue Apr 28, 2014 · 14 comments
Closed

Error trying to run grunt-lib-phantomjs on windows #59

Markavian opened this issue Apr 28, 2014 · 14 comments

Comments

@Markavian
Copy link

Running PhantomJS...ERROR
>> CreateProcessW: %1 is not a valid Win32 application. 0 [ 'CreateProcessW: %1
is not a valid Win32 application.' ]
>> In order for this task to work properly, PhantomJS must be installed locally
>> via NPM. If you're seeing this message, generally that means the NPM install
>> has failed. Please submit an issue providing as much detail as possible at:
>> https://github.com/gruntjs/grunt-lib-phantomjs/issues
Warning: PhantomJS not found. Use --force to continue.
@vladikoff
Copy link
Member

If you're seeing this message, generally that means the NPM install

has failed.

Did you see any errors during install?

@Markavian
Copy link
Author

Looked ok, npm install phantomjs:

Download already available at C:\Users\MARKAV~1\AppData\Local\Temp\phantomjs\pha
ntomjs-1.9.7-windows.zip
Extracting zip contents
Copying extracted folder C:\Users\MARKAV~1\AppData\Local\Temp\phantomjs\phantomj
s-1.9.7-windows.zip-extract-1398719957680\phantomjs-1.9.7-windows -> C:\Users\Ma
rkavian\Work\Manchester\seanblezard\beacon\node_modules\phantomjs\lib\phantom
Unable to remove temporary files at "C:\Users\MARKAV~1\AppData\Local\Temp\phanto
mjs\phantomjs-1.9.7-windows.zip-extract-1398719957680", see https://github.com/O
bvious/phantomjs/issues/108 for details.
Writing location.js file
Done. Phantomjs binary available at C:\Users\Markavian\Work\Manchester\seanbleza
rd\beacon\node_modules\phantomjs\lib\phantom\phantomjs.exe
phantomjs@1.9.7-5 node_modules\phantomjs
├── which@1.0.5
├── kew@0.1.7
├── rimraf@2.2.6
├── ncp@0.4.2
├── mkdirp@0.3.5
├── adm-zip@0.2.1
└── npmconf@0.0.24 (inherits@1.0.0, once@1.1.1, ini@1.1.0, osenv@0.0.3, semver@1
.1.4, config-chain@1.1.8, nopt@2.2.0)

npm install grunt-lib-jasmine

grunt-lib-phantomjs@0.6.0 node_modules\grunt-lib-phantomjs
├── eventemitter2@0.4.13
├── semver@1.0.14
└── temporary@0.0.8 (package@1.0.1)

There's a warning about not being able to remove a temporary directory, but phantomjs ends up installed in the root of the project, and phantomjs.exe is present / runnable.

@Markavian
Copy link
Author

Still not found a solution for this error.

@Gerolkae
Copy link

Will this Error help?

Running PhantomJS...ERROR

TypeError: Cannot call method 'charAt' of null 0 [ 'TypeError: Cannot call me
thod 'charAt' of null' ]
In order for this task to work properly, PhantomJS must be installed locally
via NPM. If you're seeing this message, generally that means the NPM install
has failed. Please submit an issue providing as much detail as possible at:
https://github.com/gruntjs/grunt-lib-phantomjs/issues
Warning: PhantomJS not found. Use --force to continue.

@mhenley-uk
Copy link

Also hitting the same error...currently have PhantomJS 1.9.7 running.

Running PhantomJS...ERROR

TypeError: Cannot call method 'charAt' of null 0 [ 'TypeError: Cannot call method 'charAt' of null' ]
In order for this task to work properly, PhantomJS must be installed locally
via NPM. If you're seeing this message, generally that means the NPM install
has failed. Please submit an issue providing as much detail as possible at:
https://github.com/gruntjs/grunt-lib-phantomjs/issues
Warning: PhantomJS not found.� Use --force to continue.

@akinnee
Copy link

akinnee commented Jul 31, 2014

Also getting this issue.

@bcherny
Copy link

bcherny commented Jul 31, 2014

+1

1 similar comment
@heldrida
Copy link

heldrida commented Aug 1, 2014

+1

@heldrida
Copy link

heldrida commented Aug 1, 2014

Issue:

Running PhantomJS...ERROR
>> TypeError: Cannot call method 'charAt' of null 0 [ 'TypeError: Cannot call method \'charAt\' of null' ]
>> In order for this task to work properly, PhantomJS must be installed locally
>> via NPM. If you're seeing this message, generally that means the NPM install
>> has failed. Please submit an issue providing as much detail as possible at:
>> https://github.com/gruntjs/grunt-lib-phantomjs/issues
Warning: PhantomJS not found. Use --force to continue.

Aborted due to warnings.

a) Fix phantomjs not found:

npm install grunt-mocha -D

But now, when running:

grunt test

I get (even though, grunt-lib-phantomjs is installed and found /node_modules):

>> Local Npm module "grunt-lib-phantomjs" not found. Is it installed?

@akinnee
Copy link

akinnee commented Aug 1, 2014

I had this issue while trying to run tests with grunt-contrib-jasmine. The last thing I did to fix it was to remove and reinstall grunt-contrib-jasmine through npm.

I suspect npm install does not work as well on Windows as Linux/Mac. Just a guess. :/

@arisAlexis
Copy link

I also have this problem, any news?

phantomjs is running OK from command prompt

@SpaTmole
Copy link

Hello, i've hit same issue as almost everyone here:

Running PhantomJS...ERROR
>> In order for this task to work properly, PhantomJS must be installed locally
>> via NPM. If you're seeing this message, generally that means the NPM install
>> has failed. Please submit an issue providing as much detail as possible at:
>> https://github.com/gruntjs/grunt-lib-phantomjs/issues
Warning: PhantomJS not found. Use --force to continue.

Aborted due to warnings.

I've solved my case with simple re-building npm dependences.
I've removed "npm_modules" and ran npm install
Moreover, i've noticed for a first time, when i was installing my dependences, that for some reason status bar of downloading just got stuck on 2%s. So i've broken that process and ran it again. After that, it seemed to be ok, but, as you could guess, it was not.
So, perhaps, the problem is some unknown reason, which stops downloading, but still pretends to be installed.

@udayas8451
Copy link

When in run jasmine using grunt i see the following message. But this generates specRunner html file.Im trying to get the test execution summary on command line. And it fails because of following message.

Running "jasmine:unit" (jasmine) task
Testing jasmine specs via PhantomJS

Warning: Cannot read property 'pid' of undefined Use --force to continue.

Aborted due to warnings.

Versions:

Phantomjsjs: 1.9.8
grunt-contrib-jasmine: ~0.9(what ever is the latest)

"grunt server --stack" logs:

TypeError: Cannot read property 'pid' of undefined
at kill (C:\nodejs\sample\node_modules\grunt-contrib-jasmine\node_modules\grun
t-lib-phantomjs\lib\phantomjs.js:59:28)
at cleanup (C:\nodejs\sample\node_modules\grunt-contrib-jasmine\node_modules\g
runt-lib-phantomjs\lib\phantomjs.js:65:31)
at C:\nodejs\sample\node_modules\grunt-contrib-jasmine\node_modules\grunt-lib-
phantomjs\lib\phantomjs.js:174:7
at callDone (C:\nodejs\sample\node_modules\grunt\node_modules\grunt-legacy-uti
l\index.js:159:5)
at Object.util.spawn (C:\nodejs\sample\node_modules\grunt\node_modules\grunt-l
egacy-util\index.js:178:7)
at EventEmitter.exports.spawn (C:\nodejs\sample\node_modules\grunt-contrib-jas
mine\node_modules\grunt-lib-phantomjs\lib\phantomjs.js:164:41)
at phantomRunner (C:\nodejs\sample\node_modules\grunt-contrib-jasmine\tasks\ja
smine.js:140:15)
at Object. (C:\nodejs\sample\node_modules\grunt-contrib-jasmine\tas
ks\jasmine.js:108:5)
at Object. (C:\nodejs\sample\node_modules\grunt\lib\grunt\task.js:2
64:15)
at Object.thisTask.fn (C:\nodejs\sample\node_modules\grunt\lib\grunt\task.js:8
2:16)

Aborted due to warnings.

Please help me. What am I doing wrong here?

Thanks!

@Arkni
Copy link
Member

Arkni commented Feb 12, 2016

From all the stack traces above, I conclude that there is a problem with the path of PhantomJS binary. The package phantomjs (aka phantomjs-prebuilt) is the one responsible for installing and providing us the path to PhantomJS binary.
So this issue has nothing to do with this package even if the error message says otherwise.

A fresh install of this package should fix the issue. If persist, please report it to https://github.com/Medium/phantomjs.

Closing this for now, feel free to ask if you have followup questions.

@Arkni Arkni closed this as completed Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests