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

generate doesn't like spaces in project path #1030

Closed
nicke opened this issue Dec 2, 2019 · 18 comments
Closed

generate doesn't like spaces in project path #1030

nicke opened this issue Dec 2, 2019 · 18 comments
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: cli

Comments

@nicke
Copy link

nicke commented Dec 2, 2019

I noticed that prisma2 generate doesn't work when path contains spaces on MacOS.

internal/modules/cjs/loader.js:582
    throw err;
    ^
Error: Cannot find module '/Users/me/devel/a'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Error:
    Error: Generator at /Users/me/devel/a b/test-prisma2/prisma2-backend/node_modules/@prisma/photon/generator-build/index.js could not start:
    internal/modules/cjs/loader.js:582
        throw err;
        ^
    Error: Cannot find module '/Users/me/devel/a'
        at Timeout.setTimeout [as _onTimeout] (/Users/me/devel/a b/test-prisma2/prisma2-backend/node_modules/prisma2/build/index.js:231407:28)
error Command failed with exit code 1.
@pantharshit00
Copy link
Contributor

Can you please share your schema.prisma file?

I was unable to reproduce this, maybe I understood the problem incorrectly:
image

@pantharshit00 pantharshit00 added topic: cli bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. labels Dec 2, 2019
@janpio
Copy link
Contributor

janpio commented Dec 3, 2019

@pantharshit00: @nicke has the spaces in the project path itself, not the output.

@nicke
Copy link
Author

nicke commented Dec 4, 2019

@janpio in project path itself. output isn‘t set.

@pantharshit00
Copy link
Contributor

pantharshit00 commented Dec 5, 2019

I am still unable to reproduce this :/
image

My cli version:prisma2@2.0.0-preview017.2, binary version: 6159bf3a263921c3c28ee68e2c9e130b5a69c293

Edit: I am using zsh but I also tried this on bash and I was still unable to reproduce this.

@nicke
Copy link
Author

nicke commented Dec 10, 2019

Hi,
you should be able to reproduce when deleting node_modules and run "npm install".

the problem happens in "@prisma/photon@2.0.0-preview018.1 postinstall"

@pantharshit00
Copy link
Contributor

I am still unable to reproduce:
image

Can you share a git repository with the reproduction?

@divyenduz
Copy link
Contributor

I couldn't reproduce this either, I will close this one, if you think that this is still an issue, please comment here and tag me. Thanks,

image

@Xaedblade
Copy link

Xaedblade commented Feb 21, 2020

@divyenduz This is still an issue, I'm on a windows machine and get this error when generating with a file path that has a space. In my case my user name for my work laptop is my first name with a space and then a last name.

Error:
`Error: EPERM: operation not permitted, mkdir 'C:\Users\C****'
TypeError: Cannot read property 'loaded' of undefined
    at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
    at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
    at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:77:20
    at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22)
    at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
    at Array.forEach (<anonymous>)
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
    at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
    at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98
  var doExit = npm.config.loaded ? npm.config.get('_exit') : true
                          ^

TypeError: Cannot read property 'loaded' of undefined
    at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
    at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
    at process.emit (events.js:198:13)
    at process._fatalException (internal/bootstrap/node.js:496:27)
Install for prisma2@latest failed with code 7`

@pantharshit00
Copy link
Contributor

pantharshit00 commented Feb 21, 2020

@Xaedblade We had a similar report here: #1642 (comment)

Please let me know if that is the same issue and if you are also using WSL

@janpio
Copy link
Contributor

janpio commented Feb 21, 2020

@Xaedblade I am on Windows and can possibly reproduce this. What node version are you using? What are the exact commands that lead to that problem?

@Xaedblade
Copy link

Hey @janpio Im on node 10.16.3

@Xaedblade
Copy link

@pantharshit00 No, I'm just running in git bash terminal on vs code. I think it may have something to do with single and double quotes nor maybe not placing quotes at all?
Thanks

@janpio
Copy link
Contributor

janpio commented Feb 24, 2020

@pantharshit00 We should probably create a user with a space in one of our VMs we are using. Do not really want to mess up my local system ;)

@pantharshit00
Copy link
Contributor

I am still unable to reproduce this:
image

Version used: prisma2@2.0.0-alpha.832, binary version: 687716d3305368e3f586f8957de2037fd8a50f8f

@Xaedblade
Copy link

I was able to find the issue on this. It appears that another package was updating the prisma client causing the issue. Thanks for looking into this!

@janpio
Copy link
Contributor

janpio commented Feb 26, 2020

Uh, can you elaborate a bit on that? Sounds interesting and we probably should be aware that this can happen and what it would look like, so we can identify this in the future if it happens to someone else.

@Xaedblade
Copy link

yes, I was using prisma-mulit-tenant and it rewrites the client file. So the issue was with that code rather then the original code.

@divyenduz
Copy link
Contributor

Linking the upstream issue here: Errorname/prisma-multi-tenant#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: cli
Projects
None yet
Development

No branches or pull requests

5 participants