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

cross-env: No such file or directory #690

Closed
zgosalvez opened this issue Mar 8, 2018 · 4 comments
Closed

cross-env: No such file or directory #690

zgosalvez opened this issue Mar 8, 2018 · 4 comments
Assignees

Comments

@zgosalvez
Copy link

Version info

3.17.5 (Both globally and locally)

Platform Information

OS X and Linux

Steps to reproduce

  1. Create a simple rules.json file
  2. Add the following in firebase.json
{
  "database": {
    "rules": "rules.json",
    "predeploy": "npm --prefix database install && npm --prefix database run build"
  }
}
  1. npm install firebase-tools --save-dev
  2. node_modules/.bin/firebase --project project-id deploy --only database --debug

Expected behavior

Successful deployment.

Actual behavior

[2018-03-08T09:21:55.755Z] ----------------------------------------------------------------------
[2018-03-08T09:21:55.760Z] Command:       /usr/local/bin/node /Users/user/project/node_modules/.bin/firebase --project project-id deploy --only database --debug
[2018-03-08T09:21:55.762Z] CLI Version:   3.17.5
[2018-03-08T09:21:55.762Z] Platform:      darwin
[2018-03-08T09:21:55.762Z] Node Version:  v6.11.5
[2018-03-08T09:21:55.763Z] Time:          Thu Mar 08 2018 17:21:55 GMT+0800 (+08)
[2018-03-08T09:21:55.763Z] ----------------------------------------------------------------------

[2018-03-08T09:21:55.801Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2018-03-08T09:21:55.803Z] > authorizing via signed-in user
[2018-03-08T09:21:55.808Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/project-id

 Thu Mar 08 2018 17:21:55 GMT+0800 (+08)
[2018-03-08T09:21:57.366Z] <<< HTTP RESPONSE 200 server=nginx, date=Thu, 08 Mar 2018 09:21:57 GMT, content-type=application/json; charset=utf-8, content-length=117, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-03-08T09:21:57.369Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/project-id/tokens

 Thu Mar 08 2018 17:21:57 GMT+0800 (+08)
[2018-03-08T09:21:58.170Z] <<< HTTP RESPONSE 200 server=nginx, date=Thu, 08 Mar 2018 09:21:58 GMT, content-type=application/json; charset=utf-8, content-length=263, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store

=== Deploying to 'project-id'...

i  deploying database
Running command: /Users/user/project/node_modules/firebase-tools/node_modules/.bin/cross-env npm --prefix database install && npm --prefix database run build
/bin/sh: /Users/user/project/node_modules/firebase-tools/node_modules/.bin/cross-env: No such file ordirectory

Error: database predeploy error: Command terminated with non-zero exit code127

Having trouble? Try firebase deploy --help

N.B.

  1. This only occurs if firebase-tools is not found in the global scope, i.e. npm install -g firebase-tools.
  2. This does not occur on version 3.17.4.
@laurenzlong
Copy link
Contributor

laurenzlong commented Mar 8, 2018

@mbleigh Can you take a look? I think this is caused by the fact that firebase-tools is installed as a local dependency, so cross-env has actually been installed at the same directory level as firebase-tools, not one level deeper at firebase-tools/node_modules.

@zgosalvez In the meanwhile, you can remove the "predeploy" section in firebase.json to be able to deploy successfully.

@mbleigh
Copy link
Contributor

mbleigh commented Mar 8, 2018

#692 should address this (I hope). @zgosalvez can you try making your firebase-tools dependency on the branch mb-xenv-fix and see if it works?

@zgosalvez
Copy link
Author

@mbleigh It works! I set it as "firebase-tools": "firebase/firebase-tools#mb-xenv-fix", and I was able to deploy successfully. Thanks. Looking forward to the release.

@zgosalvez
Copy link
Author

Resolved by v3.17.6

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

3 participants