I've searched far and wide for a solution to this but can't seem to find an answer. I've used Yeoman scaffolding many times before on my old Windows 8 PC but I can't get it working on my new Windows 8 PC.
I'm trying to scaffold an angular app using Yeoman. I did the following:
> npm install --global npm
> npm install --global yo bower grunt-cli
> npm install --global generator-angular
> mkdir mytodo && cd mytodo
> npm --version && yo --version && bower --version && grunt --version
2.5.1
1.4.6
1.4.1
grunt-cli v0.1.13
grunt v0.4.5
> yo angular
It runs up to the point where it runs bower install & npm install then shows a whole heap of errors. This is in the npm-debug.log file.
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm#2.5.1
3 info using node#v0.12.1
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose config Skipping project config: C:\Users\melon/.npmrc. (matches userconfig)
6 error install Couldn't read dependencies
7 verbose stack Error: ENOENT, open 'C:\Users\melon\package.json'
7 verbose stack at Error (native)
8 verbose cwd C:\Users\melon
9 error Windows_NT 6.2.9200
10 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
11 error node v0.12.1
12 error npm v2.5.1
13 error path C:\Users\melon\package.json
14 error code ENOPACKAGEJSON
15 error errno -4058
16 error package.json ENOENT, open 'C:\Users\melon\package.json'
16 error package.json This is most likely not a problem with npm itself.
16 error package.json npm can't find a package.json file in your current directory.
17 verbose exit [ -4058, true ]
What I find interesting in the errors is that it is referring to "C:\Users\melon\package.json". Shouldn't it be looking in the project folder for package.json (which is c:\projects\mytodo)?
Another weird thing is that it is putting a folder called node_modules inside C:\Users\melon\node_modules. This folder contains grunt, grunt-karma, jasmine-core, karma and karma-jasmine. I already have the node_modules folder in C:\Users\melon\AppData\Roaming\npm\node_modules\
If I run the following manually, it installs successfully.
> bower install
If I run the following manually, it fails.
> npm install
gifsicle#2.0.1 postinstall C:\Projects\mytodo\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-gifsicle\node_modules\gifsicle
> node lib/install.js
module.js:338
throw err;
^
Error: Cannot find module 'C:\Users\melon\lib\install.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
...........
Here is some relevant PATH details:
PATH=C:\Program Files\nodejs\;C:\Program Files (x86)\Git\cmd;C:\Ruby193\bin;C:\ant\bin;C:\Users\melon\AppData\Roaming\npm
I hope this is enough information for someone to show me where I have gone wrong. Thanks in advance.
Since I can not comment yet (need 50 rep.), I'm posting this as an answer.
Run Node.js as admin. This often helps a lot with those kind of errors.
Your PATH variable is correct (Ruby is there, so is Git).
I suggest you try npm install -g bower first because there seems to be something wrong with the package.
Have you already tried another generator (e.g. webapp)?
Related
When I create a react app on Windows with node 15 like this:
yarn create react-app my-project --template typescript
It fails with
yarn create v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.9: The platform "win32" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.0.6: The platform "win32" is incompatible with this module.
info "fsevents#2.0.6" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/4] ⠁ waiting...
[-/4] ⠁ waiting...
[3/4] ⠂ deasync
error C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments:
Directory: C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync
Output:
C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp#7.1.2
gyp info using node#15.0.1 | win32 | x64
gyp info find Python using Python version 3.7.3 found at "C:\Users\teyc\AppData\Local\Programs\Python\Python37-32\python.exe"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.8.30717.126) found at:
I don't want to install compilers. Are there binaries available for downloading?
Unfortunately, the deasync node package might not contain every binary for your node version and operating system, and yarn for some inexplicable reason requires it when running create react-app while npx doesn't.
Your options are:
Figure out how to download the prebuilt binaries into your system
https://github.com/abbr/deasync-bin
use npx
npx create react-app my-project --template typescript
use yarn 2. This is the method I prefer as it consumes less disk space
yarn set version berry
yarn create react-app myproject --template typescript
So Im trying to learn react and I could usually find quick solutions in stackoverflow but the thing is, I've many solutions suggested here like clearing the cache or changing my webpack version but I still could not fix the error and Im stumped.
C:\Users\garci\Desktop\reactApp\myfirstreact>npm start
myfirstreact#0.1.0 start C:\Users\garci\Desktop\reactApp\myfirstreact
react-scripts start
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.
The react-scripts package provided by Create React App requires a dependency:
"webpack": "4.44.2"
Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:
C:\Users\garci\node_modules\webpack (version: 1.15.0)
Manually installing incompatible versions is known to cause hard-to-debug issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.
To fix the dependency tree, try following the steps below in the exact order:
Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
Delete node_modules in your project folder.
Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
This may help because npm has known issues with package hoisting which may get resolved in future versions.
Check if C:\Users\garci\node_modules\webpack is outside your project directory.
For example, you might have accidentally installed something in your home folder.
Try running npm ls webpack in your project folder.
This will tell you which other package (apart from the expected react-scripts) installed webpack.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.
P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myfirstreact#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myfirstreact#0.1.0 start 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! C:\Users\garci\AppData\Roaming\npm-cache_logs\2021-07-22T16_21_07_888Z-debug.log
C:\Users\garci\Desktop\reactApp\myfirstreact>
and yes I tried to follow the steps given by the cli but it still give the same error. here is my debug log too.
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start'
1 verbose cli ]
2 info using npm#6.14.13
3 info using node#v14.17.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle myfirstreact#0.1.0~prestart: myfirstreact#0.1.0
6 info lifecycle myfirstreact#0.1.0~start: myfirstreact#0.1.0
7 verbose lifecycle myfirstreact#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle myfirstreact#0.1.0~start: PATH: C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-
bin;C:\Users\garci\Desktop\reactApp\myfirstreact\node_modules.bin;C:\Python39\Scripts;C:\Python3
9;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R)
Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engin
Components\iCLS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\Windo
wsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management
Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program
Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R)
Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common
Files\Intel\WirelessCommon;C:\Program Files\Microsoft SQL
Server\130\Tools\Binn;C:\ProgramData\chocolatey\bin;C:\Program
Files\nodejs;C:\Users\garci\AppData\Local\Microsoft\WindowsApps;C:\Users\garci\AppData\Roaming\np
m
9 verbose lifecycle myfirstreact#0.1.0~start: CWD: C:\Users\garci\Desktop\reactApp\myfirstreact
10 silly lifecycle myfirstreact#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle myfirstreact#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle myfirstreact#0.1.0~start: Failed to exec start script
13 verbose stack Error: myfirstreact#0.1.0 start: react-scripts start
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:375:28)
13 verbose stack at ChildProcess. (C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:375:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid myfirstreact#0.1.0
15 verbose cwd C:\Users\garci\Desktop\reactApp\myfirstreact
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v14.17.3
19 verbose npm v6.14.13
20 error code ELIFECYCLE
21 error errno 1
22 error myfirstreact#0.1.0 start: react-scripts start
22 error Exit status 1
23 error Failed at the myfirstreact#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I realize it might be that I just need to install another version of webpack but it says I should not do it manually and even if I would, I do not know how. Thanks
Just create an .env file at the root of your app and add SKIP_PREFLIGHT_CHECK=true in it. Then restart your app. It should work.
Any idea what to do? I don't have any, other than trying what it says there, "npm install" (which produces exactly the same error...) and googling, and there doesn't seem to be an answer here in stackoverflow.
Your help is appreciated, since I'm a beginner with npm, and overly frustrated month after month...
This is the "complete log" it's referred to in the error:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Daniel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install'
1 verbose cli ]
2 info using npm#6.14.9
3 info using node#v14.15.2
4 verbose npm-session 0f25ee095e558051
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall react-player#0.1.0
7 info lifecycle react-player#0.1.0~preinstall: react-player#0.1.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 4777ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 50ms
14 silly install loadShrinkwrap
15 timing stage:rollbackFailedOptional Completed in 1ms
16 timing stage:runTopLevelLifecycles Completed in 4937ms
17 silly saveTree react-player#0.1.0
18 verbose stack Error: Object for dependency "#babel/core" is empty.
18 verbose stack Something went wrong. Regenerate the package-lock.json with "npm install".
18 verbose stack If using a shrinkwrap, regenerate with "npm shrinkwrap".
18 verbose stack at C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\lib\install\inflate-shrinkwrap.js:60:29
18 verbose stack at tryCatcher (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
18 verbose stack at Object.gotValue (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\reduce.js:155:18)
18 verbose stack at Object.gotAccum (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\reduce.js:144:25)
18 verbose stack at Object.tryCatcher (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
18 verbose stack at Promise._settlePromiseFromHandler (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:517:31)
18 verbose stack at Promise._settlePromise (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:574:18)
18 verbose stack at Promise._settlePromiseCtx (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:611:10)
18 verbose stack at _drainQueueStep (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:142:12)
18 verbose stack at _drainQueue (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)
18 verbose stack at Async._drainQueues (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)
18 verbose stack at Immediate.Async.drainQueues (C:\Users\Daniel\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
18 verbose stack at processImmediate (internal/timers.js:461:21)
19 verbose cwd C:\Users\Daniel\Programming\Creative React-Redux\Chapter 3\react-player
20 verbose Windows_NT 10.0.19041
21 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Daniel\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
22 verbose node v14.15.2
23 verbose npm v6.14.9
24 error Object for dependency "#babel/core" is empty.
24 error Something went wrong. Regenerate the package-lock.json with "npm install".
24 error If using a shrinkwrap, regenerate with "npm shrinkwrap".
25 verbose exit [ 1, true ]
Thank you.
Solution:
These steps generally work for most people:
Step 1. Delete -lock.json file.
Step 2. Run, npm install
Step 3. Run, npm install #babel/core --save
I fixed it like this:
Delete node_modules folder
Delete package-lock.json
Run "npm install" in the console
I tried this.
Delete Node modules.
Delete package-lock.json file.
Then on terminal run command npm install or yarn as per your package manager.
You can fix this problem in two simple steps.
Delete node modules & package-lock.json completely.
Run the command npm install from the terminal.
I believe, now you can install new external package.
Try running this
npm install #babel/core
or
npm install --save-dev #babel/core #babel/preset-env
Problem:
I ran into the same error when trying to install #material-ui/icons and #material-ui/styles, after installing the #material-ui/core.
npm ERR! Object for dependency "#babel/core" is empty.
npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".
npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Matryoshka\AppData\Roaming\npm-cache_logs\2021-05-07T08_05_07_220Z-debug.log
PS E:\Projects\PortfolioSite\React-Portfolio-Website\react-portfolio-website>
npm install #material-ui/icons
npm ERR! Object for dependency "#babel/core" is empty.
npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".
npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Matryoshka\AppData\Roaming\npm-cache_logs\2021-05-07T08_06_04_026Z-debug.log
Solution:
Delete the package-lock.json file.
Delete all the node modules.
Run the command npm install from the terminal.
Then, I was able to install the libraries successfully.
Delete package-lock.json
yarn add #babel/core
I have installed "create-react-app" globally on my pc using "npm install create-react-app -g". And it worked just fine for months. I had previously created a lot of react app using the "create-react-app app-name" command. And it worked flawlessly. Until a few days ago when it sudden stopped working and started giving errors. I have tried various things suggested but with no luck. So after days of trying to solve the issue I am asking this question.
I have tried doing the following things:
1> using the "npm cache clean --force" and then "npm cache verify".
2> I also unabled my antivirus (norton) and then ran the commands.
3> I installed the latest node version
4> I intalled the latest npm version and updated it using the command "npm install npm#latest -g"
5> I followed the instructions on this stackoverflow link https://stackoverflow.com/questions/50189096/installing-create-react-app-gives-npm-err-shasum-check-failed-and-npm-err-unex/50191315#50191315 to change the registry.
And a few other things. But nothing has worked.
The error that I get is as follows:
D:\codes\react\maximilianUdemy\project1>create-react-app react-mytest-app
Creating a new React app in D:\codes\react\maximilianUdemy\project1\react-mytest-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2019-07-20T10_24_27_969Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... package.json
Deleting react-mytest-app/ from D:\codes\react\maximilianUdemy\project1
Done.
Below is an excerpt from the C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2019-07-20T10_24_27_969Z-debug.log. Since the log is really big (664 lines), I have only noted from when the error started showing.
471 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
471 verbose stack at JSON.parse (<anonymous>)
471 verbose stack at parseJson (D:\Program_Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
471 verbose stack at D:\Program_Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
471 verbose stack at processTicksAndRejections (internal/process/task_queues.js:85:5)
472 verbose cwd D:\codes\react\maximilianUdemy\project1\react-mytest-app
473 verbose Windows_NT 10.0.17134
474 verbose argv "D:\\Program_Files\\nodejs\\node.exe" "D:\\Program_Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
475 verbose node v12.6.0
476 verbose npm v6.9.0
477 error Unexpected end of JSON input while parsing near '...HqQqP7Ky/f49Ar0oPZ\n4'
478 verbose exit [ 1, true ]
Try to use npx create-react-app my-app
I think also information in this link will help you.
This problem is create-react-app version with respect to node version.
Create new project
npx create-react-app project_name --template all
Node
create-react-app
First use npx create-react-app, but if the problem persists ->
This will happen usually due to 1 of the two reasons :
Your npm registry is messed up somehow.
You have an old version of 'create-react-app'.
To solve this try:
Run npm get registry to see your current, and npm set registry https://registry.npmjs.org/ to set the registry to default.
To get the new version of create-react-app, simply uninstall the old one globally through npm uninstall -g create-react-app and then run npx create-react-app for creating your react app.
I am completing this angularjs tutorial
on step 3 they tell you to run the protractor by npm run protractor
when i do this inside the angular-phonecat folder nothing happens:
I have run the npm install and npm run update-webdriver command as directed beforehand.
Whats more i downloaded the android seed project and copied the code from step 3 in the tutorial to the controlers.js index.html and scenerios.js
When i run the protractor I get the following error (after my browser opens):
> angular-seed#0.0.0 protractor C:\wamp\www\angularSite
> protractor test/protractor-conf.js
Starting selenium standalone server...
Selenium standalone server started at http://10.0.7.22:55840/wd/hub
C:\wamp\www\angularSite\node_modules\protractor\node_modules\selenium-webdriver\
lib\webdriver\promise.js:1549
throw error;
^
Error: Angular could not be found on the page http://localhost:8000/app/index.ht
ml : retries looking for angular exceeded
at assertAngularOnPage (C:\wamp\www\angularSite\node_modules\protractor\lib\
protractor.js:668:13)
at C:\wamp\www\angularSite\node_modules\protractor\node_modules\selenium-web
driver\lib\goog\base.js:1178:15
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\wamp\www\angularSite\nod
e_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:14
45:20)
at notify (C:\wamp\www\angularSite\node_modules\protractor\node_modules\sele
nium-webdriver\lib\webdriver\promise.js:328:12)
at notifyAll (C:\wamp\www\angularSite\node_modules\protractor\node_modules\s
elenium-webdriver\lib\webdriver\promise.js:297:7)
at fulfill (C:\wamp\www\angularSite\node_modules\protractor\node_modules\sel
enium-webdriver\lib\webdriver\promise.js:402:7)
at Object.webdriver.promise.asap (C:\wamp\www\angularSite\node_modules\protr
actor\node_modules\selenium-webdriver\lib\webdriver\promise.js:678:5)
at webdriver.promise.ControlFlow.runInNewFrame_ (C:\wamp\www\angularSite\nod
e_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:14
56:25)
at notify (C:\wamp\www\angularSite\node_modules\protractor\node_modules\sele
nium-webdriver\lib\webdriver\promise.js:328:12)
at notifyAll (C:\wamp\www\angularSite\node_modules\protractor\node_modules\s
elenium-webdriver\lib\webdriver\promise.js:297:7)
==== async task ====
WebDriver.executeScript()
at webdriver.WebDriver.schedule (C:\wamp\www\angularSite\node_modules\protra
ctor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:267:15)
at webdriver.WebDriver.executeAsyncScript (C:\wamp\www\angularSite\node_modu
les\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:507:15
)
at Protractor.get (C:\wamp\www\angularSite\node_modules\protractor\lib\protr
actor.js:675:15)
at null.<anonymous> (C:\wamp\www\angularSite\test\e2e\scenarios.js:7:11)
at jasmine.Env.describe_ (C:\wamp\www\angularSite\node_modules\protractor\no
de_modules\minijasminenode\lib\jasmine-1.3.1.js:907:21)
at jasmine.Env.describe (C:\wamp\www\angularSite\node_modules\protractor\nod
e_modules\minijasminenode\lib\jasmine-1.3.1.js:892:15)
at describe (C:\wamp\www\angularSite\node_modules\protractor\node_modules\mi
nijasminenode\lib\jasmine-1.3.1.js:652:27)
at Object.<anonymous> (C:\wamp\www\angularSite\test\e2e\scenarios.js:5:1)
at Module._compile (module.js:456:26)
npm ERR! angular-seed#0.0.0 protractor: `protractor test/protractor-conf.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the angular-seed#0.0.0 protractor script.
npm ERR! This is most likely a problem with the angular-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! protractor test/protractor-conf.js
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-seed
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.0.6002
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "protractor"
npm ERR! cwd C:\wamp\www\angularSite
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\wamp\www\angularSite\npm-debug.log
npm ERR! not ok code 0
Here is the contents of my log file (just in case) npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'protractor' ]
2 info using npm#1.4.3
3 info using node#v0.10.26
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'preprotractor', 'protractor', 'postprotractor' ]
6 info preprotractor angular-seed#0.0.0
7 info protractor angular-seed#0.0.0
8 verbose unsafe-perm in lifecycle true
9 info angular-seed#0.0.0 Failed to exec protractor script
10 error angular-seed#0.0.0 protractor: `protractor test/protractor-conf.js`
10 error Exit status 8
11 error Failed at the angular-seed#0.0.0 protractor script.
11 error This is most likely a problem with the angular-seed package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error protractor test/protractor-conf.js
11 error You can get their info via:
11 error npm owner ls angular-seed
11 error There is likely additional logging output above.
12 error System Windows_NT 6.0.6002
13 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "protractor"
14 error cwd C:\wamp\www\angularSite
15 error node -v v0.10.26
16 error npm -v 1.4.3
17 error code ELIFECYCLE
18 verbose exit [ 1, true ]
I run windows vista x64 on my machine if that helps at all.
I have encountered this when I forgot to run my webserver. You can solve it by simply running npm start in a separate shell. Protractor does not do this for you.
Had the same issue. For me, the problem was that I had not ran "bower install". Try running "bower install" and then "npm run protractor".
I managed to get to a different error by updating the karma and karma-jasmine version in package.json
"devDependencies": {
"karma": "~0.12",
"karma-jasmine": "~0.2.0",
I then fixed something else:
https://stackoverflow.com/a/23772014/329367
I had the same problem and installing a Java Runtime fixed it for me.
The Selenium driver requires java.
Be sure to open a new console after installing so java is added to the path.
Error: Angular could not be found on the page
means protractor could probably not find ng-app on the page.
<html ng-app="yourAppName">
check your html page. some people had problems with this when the ng-app tag was not inside the outest of html elements. at level might be sufficient. (or protractor could not access your page at all).
In my case there was a problem with versions in package.json. I've tried the examples from Jonh Papa and, with my code, extracted from the AngularJS tutorial, it didn't work.
I've taken the package.json from the AngularJS tutorial, removed that of Papa, moved node_modules to node_modules__ and run npm install and now everything works as expected.
This is what solved the issue for me:
1. Delete node_modules folder
2. Run npm install