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

Commands don't work on Window (Error: Cannot find module '...\npm\node_modules\gatsby\bin\cli-new' on gatsby new) #80

Closed
anrddh opened this issue Nov 3, 2015 · 11 comments

Comments

@anrddh
Copy link

anrddh commented Nov 3, 2015

Gatsby installed successfully (no node-gyp errors), but creating a new site is throwing the error at me. I'm using Windows 10. Reinstalling gatsby didn't fix it.

Full error:

C:\Users\aniru>gatsby new test
module.js:339
    throw err;
    ^

Error: Cannot find module 'C:\Users\aniru\AppData\Roaming\npm\node_modules\gatsby\bin\cli-new'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:134:18)
    at node.js:961:3
@anrddh anrddh changed the title Error: Cannot find module '...\npm\node_modules\gatsb y\bin\cli-new' on gatsby new Error: Cannot find module '...\npm\node_modules\gatsby\bin\cli-new' on gatsby new Nov 3, 2015
@KyleAMathews
Copy link
Contributor

I'm not at all familiar with NPM on Windows... perhaps this StackOverflow answer will help? Please report back if you figure it out! http://stackoverflow.com/questions/9587665/nodejs-cannot-find-installed-module-on-windows

@MihailDemchenko
Copy link

on windows 10
need rename files
C:\Users\aniru\AppData\Roaming\npm\node_modules\gatsby\bin\gatsby-serve.js to cli-serve.js
C:\Users\aniru\AppData\Roaming\npm\node_modules\gatsby\bin\gatsby-build.js to cli-build.js
C:\Users\aniru\AppData\Roaming\npm\node_modules\gatsby\bin\gatsby-new.js to cli-new.js

@anrddh
Copy link
Author

anrddh commented Nov 9, 2015

@michaeldemchenko That fixed it! Thanks a lot. Why don't you open a PR to add this to the readme until the issue gets fixed?

@suenot
Copy link

suenot commented Nov 14, 2015

👍 have the save problem in windows 7

@KyleAMathews
Copy link
Contributor

This PR in commander.js seems related. There's been other people reporting problems with git-style subcommands on Windows.

What version of node are y'all using? Curious if it's only older versions causing trouble.

@MihailDemchenko
Copy link

I use v4.2.2

@PMByrne
Copy link

PMByrne commented Jan 13, 2016

Node v4.2.3 on Windows 10

I'm getting this as of Gatsby 0.7.7 so this is still an issue.

@SaintPeter
Copy link

Same issue on Windows 10, Node v4.2.2, Gatsby 0.7.7

Renaming the files as described above fixed the issue for me.

Thanks @michaeldemchenko

@cable729
Copy link

cable729 commented Feb 1, 2016

Same issue on Windows 10, Node v5.5.0, Gatsby 0.7.7. Although, I had to update different files:

%appdata%\npm\node_modules\gatsby\bin\cli.js => cli-serve.js
%appdata%\npm\node_modules\gatsby\bin\gatsby-build.js => cli-build.js 
%appdata%\npm\node_modules\gatsby\bin\gatsby-new.js => cli-new.js

And to run gatsby develop I had to do rename

%appdata%\npm\node_modules\gatsby\bin\gatsby-develop.js => cli-develop.js

@KyleAMathews KyleAMathews changed the title Error: Cannot find module '...\npm\node_modules\gatsby\bin\cli-new' on gatsby new Commands don't work on Window (Error: Cannot find module '...\npm\node_modules\gatsby\bin\cli-new' on gatsby new) Feb 7, 2016
@NogsMPLS NogsMPLS mentioned this issue Feb 27, 2016
@KyleAMathews
Copy link
Contributor

Hey peeps, @NogsMPLS submitted a PR which should fix this issue. I released 0.8.5 with his PR included — could some of you install this and report back if Gatsby does indeed now work correctly on Windows?

@KyleAMathews
Copy link
Contributor

Closing this out. Please comment if this problem still exists or open a new issue if you discover other problems on Windows.

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

7 participants