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

Regression: In version 0.1.4, the ember new command is fails on Windows #2677

Closed
nosachamos opened this issue Dec 5, 2014 · 50 comments · Fixed by resugar/resugar#65
Closed
Labels
Milestone

Comments

@nosachamos
Copy link

Tested on Windows 8, using Ember 0.1.4.

I upgraded from version 0.1.2:
npm uninstall -g ember-cli && npm cache clear && npm install -g ember-cli@0.1.4

Then attempted the ember new, but it failed consistently with the same error many times:

Installing packages for tooling via npm...
npm ERR! Failed resolving git HEAD (undefined) fatal: ambiguous argument 'undefined': unknown revision or path not in the working tree.
npm ERR! Failed resolving git HEAD (undefined) Use '--' to separate paths from revisions, like this:
npm ERR! Failed resolving git HEAD (undefined) 'git <command> [<revision>...] -- [<file>...]'
npm ERR! Failed resolving git HEAD (undefined)

c:\Users\Eduardo Born\AppData\Roaming\npm\node_modules\ember-cli\node_modules\npm\lib\cache\add-remote-git.js:190
        return cb(er)
               ^
TypeError: undefined is not a function
    at c:\Users\Eduardo Born\AppData\Roaming\npm\node_modules\ember-cli\node_modules\npm\lib\cache\add-remote-git.js:190:16
    at ChildProcess.exithandler (child_process.js:652:7)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

I can reproduce this anytime on my system let me know if I can provide more info.

Reverting to 0.1.2 for now as it works fine in this case.

@stefanpenner
Copy link
Contributor

awesome thanks

@nosachamos nosachamos changed the title Regression: In version 0.14, the ember new command is fails on Windows Regression: In version 0.1.4, the ember new command is fails on Windows Dec 5, 2014
@herom
Copy link

herom commented Dec 5, 2014

same here - also fails with ember init (which should not be too unexpected though 😃)

Using ember-cli 0.1.4 on Windows 7 Professional 64bit.

@stefanpenner
Copy link
Contributor

ya its just one of our deps deps, and likely your firewall or something blocking the git only dep.

Someone will need to do the leg work of ensuring everything is fixed and upgraded.

@rwjblue
Copy link
Member

rwjblue commented Dec 5, 2014

#2605 (comment)

@vais
Copy link
Contributor

vais commented Dec 7, 2014

@stefanpenner It's not a firewall or any kind of networking issue - I am getting the same exact error on my Win XP VM (while it's working fine on the host Mac OS). Also, the Windows has working git installation on PATH. Hope this helps resolve this show-stopper...

@vais
Copy link
Contributor

vais commented Dec 7, 2014

A little more info from my Windows XP VM to help troubleshoot:

  1. add-remote-git.js resolveHead calls utils/git.js whichAndExec which calls execGit which calls exec("git", ["-c","core.longpaths=true","config","--get","remote.origin.url"], {"cwd":"C:\\Documents and Settings\\Administrator\\Application Data\\npm-cache\\_git-remotes\\git-github-com-ariya-esprima-git-9077e517"})
  2. The er passed back to resolveHead's cb is {"killed":false,"code":128,"signal":null}
  3. If I cd into that cwd manually and execute the same git command I get no errors:
C:\Documents and Settings\Administrator\Application Data\npm-cache\_git-remotes\git-github-com-ariya-esprima-git-9077e517>git -c core.longpaths=true config --get remote.origin.url
git://github.com/ariya/esprima.git

C:\Documents and Settings\Administrator\Application Data\npm-cache\_git-remotes\git-github-com-ariya-esprima-git-9077e517>

Let me know if there's anything else I can do to help get to the bottom of this.

@kidGodzilla
Copy link

Not sure if this provides any insight or not, but I updated from ember-cli 0.1.1 -> 0.1.4 manually on Windows 8 without any issues. Repro'd, my mistake

@vais
Copy link
Contributor

vais commented Dec 7, 2014

@kidGodzilla did you try to run ember new ...?

@stefanpenner
Copy link
Contributor

someone needs to do the leg work and update the deps. I may have time later this week.

@rwjblue
Copy link
Member

rwjblue commented Dec 8, 2014

For those interested in doing the leg work: #2605 (comment) lists the steps that are needed.

@johnnyshields
Copy link
Contributor

👍 Same issue on Windows 7, ember-cli 0.1.4. Version 0.1.2 works fine.

@edborden
Copy link

First timer making the plunge from EAK to Ember-CLI and ran into this issue on Windows 8.1. Since it wasn't immediately obvious to me, I thought I'd note here that running ember new on 0.1.2 works fine, then you can follow the upgrade procedure to get to 0.1.4 once you have the project set up.

@stefanpenner stefanpenner added this to the v0.1.5 milestone Dec 12, 2014
@johnnyshields
Copy link
Contributor

Might be nice to put a note in the Getting Started guide for us poor Windows folk...

@stefanpenner
Copy link
Contributor

@johnmcdowall better result would be if someone has time to follow these steps #2605 (comment) and solve the problem

@raytiley
Copy link
Member

I'll look into this later today

@stefanpenner
Copy link
Contributor

@raytiley :)

@stefanpenner
Copy link
Contributor

I'm aiming to cut a release sunday night.

@raytiley
Copy link
Member

@stefanpenner I'll do my best to get a pr together tonight if I can fix it in CLI. Haven't looked much at this yet since I'm on my phone.

@johnmcdowall
Copy link
Contributor

@stefanpenner you rang?

raytiley added a commit to raytiley/esnext that referenced this issue Dec 13, 2014
@raytiley
Copy link
Member

I submitted a PR on esnext that according to @rwjblue should remove the npm git installs.

@raytiley
Copy link
Member

@vias @johnnyshields what versions of git / npm / bower do you have installed on your machines. Are you using cmd, powershell, or git bash? I can sort of reproduce this but not sure I'm reproducing the same issue.

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

git version 1.9.4.msysgit.0
npm 1.4.14
bower 1.3.12

@raytiley
Copy link
Member

@broerse thanks. Can you give your exact console output? When running ember new

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

version: 0.1.4
Could not find watchman, falling back to NodeWatcher for file system events
installing
  create .bowerrc
  create .editorconfig
  create .ember-cli
  create .jshintrc
  create .travis.yml
  create Brocfile.js
  create README.md
  create app/app.js
  create app/components/.gitkeep
  create app/controllers/.gitkeep
  create app/helpers/.gitkeep
  create app/index.html
  create app/models/.gitkeep
  create app/router.js
  create app/routes/.gitkeep
  create app/styles/app.css
  create app/templates/application.hbs
  create app/templates/components/.gitkeep
  create app/views/.gitkeep
  create bower.json
  create config/environment.js
  create .gitignore
  create package.json
  create public/.gitkeep
  create public/crossdomain.xml
  create public/robots.txt
  create testem.json
  create tests/.jshintrc
  create tests/helpers/resolver.js
  create tests/helpers/start-app.js
  create tests/index.html
  create tests/test-helper.js
  create tests/unit/.gitkeep
  create vendor/.gitkeep
Installing packages for tooling via npm...
npm ERR! Failed resolving git HEAD (undefined) fatal: Not a git repository (or a
ny of the parent directories): .git
npm ERR! Failed resolving git HEAD (undefined)

C:\Users\Martin\AppData\Roaming\npm\node_modules\ember-cli\node_modules\npm\lib\
cache\add-remote-git.js:190
        return cb(er)
               ^
TypeError: undefined is not a function
    at C:\Users\Martin\AppData\Roaming\npm\node_modules\ember-cli\node_modules\n
pm\lib\cache\add-remote-git.js:190:16
    at ChildProcess.exithandler (child_process.js:651:7)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:755:16)
    at Process.ChildProcess._handle.onexit (child_process.js:822:5)

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

ember init on an old project worked fine some days ago. Have not tested again today but it should still work.

@raytiley
Copy link
Member

@broerse curious... what happens when you do npm install in the new ember directory after the failure?

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

tested on a windows 7 pc just now and it gave the same error.
git version 1.9.4.msysgit.2
npm 1.4.14
bower 1.3.12

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

C:\dev\meetup5>npm install
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er requires abbrev@'~1.0.4' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er requires bower-config@'~0.5.2' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er requires chalk@'0.5.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er requires inquirer@'0.7.1' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er requires mkdirp@'0.5.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er requires nopt@'~3.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er requires rimraf@'~2.2.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er requires semver@'~2.3.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\glo
b requires minimatch@'^1.0.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er\node_modules\bower-registry-client requires bower-config@'~0.5.0' but will lo
ad
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er\node_modules\bower-registry-client requires rimraf@'~2.2.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er\node_modules\bower-registry-client\node_modules\request requires node-uuid@'~
1.4.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency C:\dev\meetup5\node_modules\ember-cli\node_modules\bow
er\node_modules\bower-registry-client\node_modules\request-replay requires retry
@'~0.6.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined

C:\dev\meetup5>

@raytiley
Copy link
Member

Ok last question, can you attatche the package.json that ember new generated for you.

Thanks for all the help... I can't reproduce what your seeing here...so I"m splunking through the npm module trying to figure out where its going wrong

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

{
  "name": "meetup5",
  "version": "0.0.0",
  "private": true,
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "start": "ember server",
    "build": "ember build",
    "test": "ember test"
  },
  "repository": "",
  "engines": {
    "node": ">= 0.10.0"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "broccoli-asset-rev": "^1.0.0",
    "broccoli-ember-hbs-template-compiler": "^1.6.1",
    "ember-cli": "0.1.4",
    "ember-cli-content-security-policy": "0.3.0",
    "ember-cli-dependency-checker": "0.0.6",
    "ember-cli-esnext": "0.1.1",
    "ember-cli-ic-ajax": "0.1.1",
    "ember-cli-inject-live-reload": "^1.3.0",
    "ember-cli-qunit": "0.1.2",
    "ember-data": "1.0.0-beta.12",
    "ember-export-application-global": "^1.0.0",
    "express": "^4.8.5",
    "glob": "^4.0.5"
  }
}

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

without an error?

C:\dev\meetup5>npm install --save-dev ember-cli@0.1.4
ember-cli@0.1.4 node_modules\ember-cli
├── abbrev@1.0.5
├── js-string-escape@1.0.0
├── debug@2.1.0 (ms@0.6.2)
├── temp@0.8.1 (rimraf@2.2.8)
├── symlink-or-copy@1.0.1 (copy-dereference@1.0.0)
├── http-proxy@1.7.3 (requires-port@0.0.0, eventemitter3@0.1.6)
├── yam@0.0.17 (lodash@2.4.1, findup@0.1.5, fs-extra@0.8.1)
├── broccoli-writer@0.1.1 (rsvp@3.0.14, quick-temp@0.1.2)
└── broccoli-caching-writer@0.5.1 (promise-map-series@0.2.0, rimraf@2.2.8, brocc
oli-kitchen-sink-helpers@0.2.5, rsvp@3.0.14, quick-temp@0.1.2, core-object@0.0.2
)

C:\dev\meetup5>

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

Yes after bower install I can now run ember serve there is still one bug. Even if you can't install watchman on windows it keeps saying Could not find watchman, falling back to NodeWatcher for file system events

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

You don't want to be reminded you can't do things because you are on windows every day ;-)

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

the change to package.json is that a ^ is added to "ember-cli": "^0.1.4",

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

You can do npm install in the new ember directory after the failure if you first remove the node_modules folder.

@raytiley
Copy link
Member

I feel like this might be related. npm/npm#5702

It seems we are hitting some weird caching issue w/ git repositories. from @vais stack trace it looks like the git SHA that was part of the CWD doesn't even exist anymore, maybe due to a rebase or force push? I wonder if this is more brittle on windows for some reason?

@broerse could you go into this folder: C:\Users\Martin\AppData\Roaming\npm-cache on your machine and make sure its empty, and then try an ember new command?

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

cleared the npm-cache => same error

@raytiley
Copy link
Member

wtf... why can't i reproduce :(

I gotta go eat dinner... will come back to this later.

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

It is 23:30. Last fetched item before the error seems to be git-github-com-ariya-esprima-git-9077e517

@broerse
Copy link
Contributor

broerse commented Dec 13, 2014

git clone git://github.com/ariya/esprima is working normaly
npm update to 2.1.12 does not help.
npm/npm#6322 -> It means that there's probably a proxy between you and the internet. More to the point, this isn't a good way to depend on a package using git, as the es6- maintainers seem to have realized subsequently to version 0.3.1 of their packages – 0.4.1 depends on an actual published version of the packages. Bug the gulp-esnext maintainers to update its dependencies to use the newer versions with better packaging.

@raytiley
Copy link
Member

@stefanpenner @rwjblue esnext is updated / released so it should hopefuly fix this issue with the next ember-cli release resugar/resugar#65

Not sure if we can do anything to trap these errors better in ember-cli... One idea might be to configure CI server to disallow git protocol just so we can see these problems in CI?

@stefanpenner
Copy link
Contributor

@raytiley ya thats a good idea. We can also add a test to walk the deps and confirm no git URLs

@vais
Copy link
Contributor

vais commented Dec 14, 2014

@raytiley wtf indeed - I cannot reproduce this issue anymore on the same machine. Last time before calling it quits I did npm uninstall -g ember-cli. I installed it again today, npm install ember-cli, did ember new app and it ran without errors. I will try on another machine at the office tomorrow...

@phillipsj
Copy link
Contributor

I just did an ember-cli upgrade and everything ran fine for me. I have also generated a few test projects without issue.

@raytiley
Copy link
Member

Is anyone still having this issue? Now that resugar/resugar#65 landed I think this could be closed?

@rwjblue
Copy link
Member

rwjblue commented Dec 17, 2014

@raytiley - Do we need to update broccoli-esnext and ember-cli-esnext to get the right version?

@edborden
Copy link

No longer errors on Windows 8.1 for me.

@stefanpenner
Copy link
Contributor

lets assume we are good :)

@vais
Copy link
Contributor

vais commented Dec 17, 2014

@stefanpenner after re-installing ember-cli 0.1.4 on the original machine, I cannot repro this issue. Installed on two machines in the office, ember new works fine. I think it is safe to close this issue (and re-open later if @nosachamos can still repro it after uninstalling and re-installing ember-cli 0.1.4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.