Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Cannot install on Windows #56

Closed
milesj opened this issue Jun 11, 2015 · 18 comments
Closed

Cannot install on Windows #56

milesj opened this issue Jun 11, 2015 · 18 comments

Comments

@milesj
Copy link

milesj commented Jun 11, 2015

This is my setup:

Windows 7
Python 2.7.2 installed to C:\Python27
Node.js 0.12.4 and NPM 2.10.1 installed via the Windows installer
Atom 0.208.0 and APM 0.171.0 installed via the Windows installer

I keep receiving the following errors when executing the scripts\dev\setup file. I'm also running this as an administration through the command prompt.

START INSTALL: 2015-06-10 19:53:21.311000
Installing dependencies for Node package nuclide-node-transpiler...
Traceback (most recent call last):
  File "scripts\dev\setup", line 44, in <module>
    package_manager.install_dependencies(npm, include_packages_that_depend_on_atom=include_apm)
  File "scripts\dev\../lib\package_manager.py", line 47, in install_dependencies
    installer.install()
  File "scripts\dev\../lib\package_manager.py", line 151, in install
    self._do_serial_install()
  File "scripts\dev\../lib\package_manager.py", line 157, in _do_serial_install
    install_dependencies(config, self._npm)
  File "scripts\dev\../lib\package_manager.py", line 315, in install_dependencies
    npm.install(package_config['packageRootAbsolutePath'], local_packages=package_config['localDependencies'], include_dev_dependencies=package_config['includeDevDependencies'])
  File "scripts\dev\../lib\npm.py", line 49, in install
    self._npm_install(package_root, include_dev_dependencies)
  File "scripts\dev\../lib\npm.py", line 55, in _npm_install
    self._execute(npm_command, cwd=package_root)
  File "scripts\dev\../lib\npm.py", line 85, in _execute
    output = fs.cross_platform_check_output(cmd_args, cwd=cwd, stderr=devnull)
  File "scripts\dev\../lib\fs.py", line 91, in cross_platform_check_output
    raise subprocess.CalledProcessError(returncode, cmd_args, output=stdout)
subprocess.CalledProcessError: Command '['npm', 'install']' returned non-zero exit status 1

My projects are installed to a separate drive, the E: drive, so I'm curious if that's an issue in itself.

I've also tried this patch found in another issue, no go. https://github.com/apuckey/nuclide/commit/f33bdcef41125de52724e36a224f0f2688d03124

Any help would be appreciated.

@bolinfest
Copy link
Contributor

I believe 5903a22 should fix things for you. My test environment was:

  • Windows 7
  • Python 2.7.6
  • Node 0.12.4
  • npm 2.10.1
  • Atom 0.208.0

The root README.md has been updated to call out how the setup script should be run on Windows:

python scripts\dev\setup

In particular, you should not have to run it as an administrator! In particular, I suspect it might cause other problems down the road if you do.

@milesj
Copy link
Author

milesj commented Jun 12, 2015

Updated master to the latest, still not working.

START INSTALL: 2015-06-11 19:13:03.403000
Installing dependencies for Node package nuclide-node-transpiler...
Traceback (most recent call last):
  File "scripts\dev\setup", line 44, in <module>
    package_manager.install_dependencies(npm, include_packages_that_depend_on_atom=include_apm)
  File "scripts\dev\../lib\package_manager.py", line 45, in install_dependencies
    installer.install()
  File "scripts\dev\../lib\package_manager.py", line 152, in install
    self._do_serial_install()
  File "scripts\dev\../lib\package_manager.py", line 158, in _do_serial_install
    install_dependencies(config, self._npm)
  File "scripts\dev\../lib\package_manager.py", line 317, in install_dependencies
    npm.install(src_path, local_packages=package_config['localDependencies'], include_dev_dependencies=package_config['includeDevDependencies'])
  File "scripts\dev\../lib\npm.py", line 49, in install
    self._npm_install(package_root, include_dev_dependencies)
  File "scripts\dev\../lib\npm.py", line 55, in _npm_install
    self._execute(npm_command, cwd=package_root)
  File "scripts\dev\../lib\npm.py", line 85, in _execute
    output = fs.cross_platform_check_output(cmd_args, cwd=cwd, stderr=devnull)
  File "scripts\dev\../lib\fs.py", line 82, in cross_platform_check_output
    raise subprocess.CalledProcessError(returncode, cmd_args, output=stdout)
subprocess.CalledProcessError: Command '['npm', 'install']' returned non-zero exit status 1

@bolinfest
Copy link
Contributor

@milesj What happens when you run the failed npm install command manually from the command line? I'm suspicious that npm was installed such that you have to be an administrator to use it (or perhaps just to write to your ~/.npm directory).

I identified some common problems people were having at #23 (comment).

@milesj
Copy link
Author

milesj commented Jun 12, 2015

I use NPM/Node constantly, even before attempting to install this. I could try uninstalling and reinstalling to see if it makes a difference.

@bolinfest
Copy link
Contributor

For good measure, could you run git clean -xfd first? Maybe there's some bad stuff leftover from previous attempts?

@bolinfest
Copy link
Contributor

I'll reopen.

@bolinfest bolinfest reopened this Jun 12, 2015
@milesj
Copy link
Author

milesj commented Jun 13, 2015

Still getting the same error. I have a pretty unusual setup, so I'm wondering if that's the issue. All of my programs are installed to E: instead of C:, so maybe it's a cross drive permissions issue?

Are there any logs being written that I can dig into?

Also running npm install works fine. Just errors out because no package.json.

E:\Projects\nuclide>npm install
npm ERR! install Couldn't read dependencies
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "E:\\Programs\\nodejs\\\\node.exe" "E:\\Programs\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! path E:\Projects\nuclide\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -4058

npm ERR! package.json ENOENT, open 'E:\Projects\nuclide\package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\Projects\nuclide\npm-debug.log

@bolinfest
Copy link
Contributor

Late today I updated the scripts to provide a little more info on failure.
Could you update and try again?

On Friday, June 12, 2015, Miles Johnson notifications@github.com wrote:

Still getting the same error. I have a pretty unusual setup, so I'm
wondering if that's the issue. All of my programs are installed to E:
instead of C:, so maybe it's a cross drive permissions issue?

Are there any logs being written that I can dig into?

Also running npm install works fine. Just errors out because no
package.json.

E:\Projects\nuclide>npm install
npm ERR! install Couldn't read dependencies
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "E:\Programs\nodejs\node.exe" "E:\Programs\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! path E:\Projects\nuclide\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -4058

npm ERR! package.json ENOENT, open 'E:\Projects\nuclide\package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! Please include the following file with any support request:
npm ERR! E:\Projects\nuclide\npm-debug.log


Reply to this email directly or view it on GitHub
#56 (comment).

@bolinfest
Copy link
Contributor

Also, are there any spaces in your paths???

On Friday, June 12, 2015, Michael Bolin bolinfest@gmail.com wrote:

Late today I updated the scripts to provide a little more info on failure.
Could you update and try again?

On Friday, June 12, 2015, Miles Johnson <notifications@github.com
javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

Still getting the same error. I have a pretty unusual setup, so I'm
wondering if that's the issue. All of my programs are installed to E:
instead of C:, so maybe it's a cross drive permissions issue?

Are there any logs being written that I can dig into?

Also running npm install works fine. Just errors out because no
package.json.

E:\Projects\nuclide>npm install
npm ERR! install Couldn't read dependencies
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "E:\Programs\nodejs\node.exe" "E:\Programs\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! path E:\Projects\nuclide\package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno -4058

npm ERR! package.json ENOENT, open 'E:\Projects\nuclide\package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.

npm ERR! Please include the following file with any support request:
npm ERR! E:\Projects\nuclide\npm-debug.log


Reply to this email directly or view it on GitHub
#56 (comment).

@milesj
Copy link
Author

milesj commented Jun 13, 2015

There are some spaces in my paths but none of which related to these tools. Here's both my user and system paths.

C:\Ruby193\bin;%CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Users\Miles\AppData\Local\atom\bin;C:\Users\Miles\AppData\Roaming\npm

C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;E:\Programs (32)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\Composer\bin;C:\Program Files (x86)\git\bin;C:\Program Files (x86)\git\cmd;E:\Data\Sqlite;E:\Data\MongoDB\bin;C:\cygwin\bin;C:\cygwin64\bin;C:\Program Files\Oracle\VirtualBox;C:\Python34;C:\HashiCorp\Vagrant\bin;C:\Users\Miles\AppData\Roaming\Composer\vendor\bin;E:\Wamp\bin\php\php5.4.3;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Miles\AppData\Local\atom\bin;C:\Python27;E:\Programs\nodejs\

@milesj
Copy link
Author

milesj commented Jun 13, 2015

I believe I found the issue. Gimme a few minutes.

@milesj
Copy link
Author

milesj commented Jun 13, 2015

Yeah, turned out that git wasn't in my path. That error wasn't apparent till I tried running npm install in the nuclide-node-transpiler folder, as I assumed NPM was downloading archives, not using git. I also recently switched to SourceTree for git projects, which has a self contained git, and the old system git was removed.

Sorry about that.

Perhaps if there's a way to grab the error message from npm install, might be useful in the future, instead of simply saying that the call failed.

@milesj milesj closed this as completed Jun 13, 2015
@bolinfest
Copy link
Contributor

Ah ha, thanks! I believe there is one transitive Node dependency that is
specified by Git URI or something like that. This likely explains the
failures that others are seeing, as well. We'll fix the docs and dump the
error messages, as you suggest.

Out of curiosity, how did you choose to clone the Nuclide repo if Git isn't
on your path? Some sort of GUI?

On Friday, June 12, 2015, Miles Johnson notifications@github.com wrote:

Yeah, turned out that git wasn't in my path. That error wasn't apparent
till I tried running npm install in the nuclide-node-transpiler folder,
as I assumed NPM was downloading archives, not using git. I also recently
switched to SourceTree for git projects, which has a self contained git,
and the old system git was removed.

Sorry about that.

Perhaps if there's a way to grab the error message from npm install,
might be useful in the future, instead of simply saying that the call
failed.


Reply to this email directly or view it on GitHub
#56 (comment).

@bolinfest
Copy link
Contributor

I just re-read your post. I guess SourceTree caused the problem?

On Friday, June 12, 2015, Michael Bolin bolinfest@gmail.com wrote:

Ah ha, thanks! I believe there is one transitive Node dependency that is
specified by Git URI or something like that. This likely explains the
failures that others are seeing, as well. We'll fix the docs and dump the
error messages, as you suggest.

Out of curiosity, how did you choose to clone the Nuclide repo if Git
isn't on your path? Some sort of GUI?

On Friday, June 12, 2015, Miles Johnson <notifications@github.com
javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

Yeah, turned out that git wasn't in my path. That error wasn't apparent
till I tried running npm install in the nuclide-node-transpiler folder,
as I assumed NPM was downloading archives, not using git. I also recently
switched to SourceTree for git projects, which has a self contained git,
and the old system git was removed.

Sorry about that.

Perhaps if there's a way to grab the error message from npm install,
might be useful in the future, instead of simply saying that the call
failed.


Reply to this email directly or view it on GitHub
#56 (comment).

@milesj
Copy link
Author

milesj commented Jun 13, 2015

SourceTree uses its own Git, so cloning that is no issue. Once I started using the command line outside of SourceTree (Windows cmd prompt), Git was no longer available.

@bolinfest
Copy link
Contributor

FYI, it is this transitive dependency in a package.json that causes the issue:

"jasmine-node": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef",

So npm install doesn't normally need Git, but for this dependency, it does.

I'm updating the System Requirements to reflect this.

@milesj
Copy link
Author

milesj commented Jun 13, 2015

Nice find.

Is there a way for Nuclide to include that dependency manually and avoid Git while having the package that requires it use the local one? Not sure how much customization NPM allows unlike Composer.

@bolinfest
Copy link
Contributor

@milesj Yes! I moved our test runner (that depends on jasmine-focused, which depends on git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef) into a new nuclide-jasmine package, which is now listed under devDependencies in all of our package.json files as of 33ffc40.

If you use npm install --production, it will not try to install devDependencies. This is good for end-users because apm install calls npm install --production. However, we assume that developers are trying to develop, so we don't want to exclude devDependencies when npm install is called from ./scripts/dev/setup.

So I'm not sure if this fixes things for you in the developer case, but it will fix things for users who install the prebuilt packages via Atom and do not have Git on their $PATH.

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

No branches or pull requests

2 participants