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

Netlify build on Windows 10 producing an error #318

Closed
talves opened this issue Oct 17, 2019 · 25 comments
Closed

Netlify build on Windows 10 producing an error #318

talves opened this issue Oct 17, 2019 · 25 comments
Assignees
Labels
type: bug code to address defects in shipped code

Comments

@talves
Copy link

talves commented Oct 17, 2019

Using this example on the local system (Win10) gives an error found in the screen capture below.

image

Used --dry --verbose to give as much info as possible, but it also fails without those tags with same errors.

Node: v10.16.0
npm: v6.9.0
Yarn: v1.17.3

@talves
Copy link
Author

talves commented Oct 17, 2019

I'm using a local dependency of the netlify-cli to try to debug, but did not have luck on first pass. Let me know if there is any information I can give to help debug the issue.

@DavidWells
Copy link
Contributor

@ehmicky this is the plugin code https://github.com/talves/netlify-plugin-debug/blob/12806b6b7a97a12a13be257d7ba5332c43fbe79a/plugins/debug/index.js

(long shot) Perhaps this has something to do with the emojis used?

@ehmicky
Copy link
Contributor

ehmicky commented Oct 18, 2019

We are aiming at completely supporting Windows very soon but at the moment this is likely that netlify/build does not work 100% on Windows. I've added #320 to track this.

Also #314 might solve this specific issue (although I am not sure about this).

@talves
Copy link
Author

talves commented Oct 18, 2019

@DavidWells FYI, I dev on Windows 10 🤣🤣

@ehmicky ehmicky added the bug label Oct 18, 2019
@ehmicky ehmicky self-assigned this Oct 22, 2019
@ehmicky ehmicky added this to Backlog in Netlify Build Oct 22, 2019
@ehmicky ehmicky moved this from Backlog to In progress in Netlify Build Oct 25, 2019
@ehmicky
Copy link
Contributor

ehmicky commented Oct 25, 2019

@talves I've added some Windows-related fixes. Could you please confirm whether your issue is still happening? Thanks!

@talves
Copy link
Author

talves commented Oct 25, 2019

@ehmicky got this, but might be me?

When I console.log({ pluginsOptions });, I get:

{ pluginsOptions: { debugPlugin: { type: './plugins/debug' } } }

image

@ehmicky
Copy link
Contributor

ehmicky commented Oct 25, 2019

@talves that bug should be solved in the latest version. This was due to us using an old version of one of our dependencies (@netlify/config).

@talves
Copy link
Author

talves commented Oct 25, 2019

running: Found "netlify-cli@2.19.3"

=> Found "@netlify/config@0.0.3"
info Reasons this module exists
   - "netlify-cli#@netlify#build" depends on it
   - Hoisted from "netlify-cli#@netlify#build#@netlify#config"

@talves
Copy link
Author

talves commented Oct 25, 2019

@ehmicky this might be my issue with my config. Expects array for plugins now?

@ehmicky
Copy link
Contributor

ehmicky commented Oct 25, 2019

No we just forgot to make a new release of netlify/cli. We just released 2.19.4, this should fix that issue :)

@talves
Copy link
Author

talves commented Oct 25, 2019

So, this is correct for a config in netlify.yml?

build:
  publish: public
  functions: functions

  lifecycle:
    init:
      - echo "Starting the build"
    build:
      - echo "hello world"
    finally:
      - echo "Ending the build"

plugins:
  debugPlugin:
    type: ./plugins/debug

@ehmicky
Copy link
Contributor

ehmicky commented Oct 25, 2019

We changed the syntax for plugins. It is now an array of objects:

plugins:
  - id: debugPlugin
    type: ./plugins/debug
    config: 
      foo: bar

Apart from this, all good 👍

@talves
Copy link
Author

talves commented Oct 25, 2019

Yeah, so that is what I was saying 👆 is I also have an error 😂 and name required in plugin. Good Errors by the way!

@talves
Copy link
Author

talves commented Oct 25, 2019

Back to where we started, unfotunately, sorry.

image

@ehmicky
Copy link
Contributor

ehmicky commented Oct 25, 2019

Could you please send the output of the following command?

npx envinfo --system --binaries --npmPackages @netlify/build @netlify/config

Also: are you using regular cmd.exe, Git for Windows, WSL or Powershell?

@talves
Copy link
Author

talves commented Oct 25, 2019

Git Bash, but I can run in any terminal. Not using WSL.

@talves
Copy link
Author

talves commented Oct 25, 2019

  System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
    Memory: 6.70 GB / 15.95 GB
  Binaries:
    Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.19.1 - D:\Git\Netlify\plugins\netlify-plugin-debug\node_modules\.bin\yarn.CMD
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD

@ehmicky
Copy link
Contributor

ehmicky commented Oct 28, 2019

I've tried to reproduce your issue with the same configuration, but it did not reproduce it.

Using Git Bash:

$ git clone git@github.com:talves/netlify-plugin-debug.git

$ cd netlify-plugin-debug

$ npm install

$ npx envinfo --system --binaries --npmPackages @netlify/build,@netlify/config,netlify-cli

  System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 5.29 GB / 8.00 GB
  Binaries:
    Node: 10.6.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.19.1 - ~\code\netlify-plugin-debug\node_modules\.bin\yarn.CMD
    npm: 6.1.0 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    netlify-cli: ^2.19.4 => 2.19.5

$ npx netlify build
> Starting Netlify Build v0.0.34
  https://github.com/netlify/build

Options
  { config: 'C:\\Users\\ehmic\\code\\netlify-plugin-debug\\netlify.yml',
  verbose: undefined }

> Using config file:
  C:\Users\ehmic\code\netlify-plugin-debug\netlify.yml

> Installing plugins dependencies
npm WARN debug@1.0.0 No description
npm WARN debug@1.0.0 No repository field.

up to date in 0.037s

> Loading plugins
  Loading plugin "@netlify/plugin-functions-core" from build core
  Loading plugin "debugPlugin" from ./plugins/debug

> Running Netlify Build Lifecycle
  Found 16 steps. Lets do this!

+----------------------------------------------------------------------------------+
| 1. Running init lifecycle from build.lifecycle.init in netlify.yml config file   |
+----------------------------------------------------------------------------------+

Running command "echo "Starting the build""
"Starting the build"

   build.lifecycle.init completed in 278ms

+-----------------------------------------------------------------+
| 2. Running init lifecycle from @netlify/plugin-functions-core   |
+-----------------------------------------------------------------+


   @netlify/plugin-functions-core.init completed in 927ms

+----------------------------------------------+
| 3. Running init lifecycle from debugPlugin   |
+----------------------------------------------+

Build Starting 

   debugPlugin.init completed in 926ms

+--------------------------------------------------+
| 4. Running getCache lifecycle from debugPlugin   |
+--------------------------------------------------+

Fetching the last builds cache 

   debugPlugin.getCache completed in 716ms

+--------------------------------------------------------------------+
| 5. Running install lifecycle from @netlify/plugin-functions-core   |
+--------------------------------------------------------------------+


   @netlify/plugin-functions-core.install completed in 824ms

+-------------------------------------------------+
| 6. Running install lifecycle from debugPlugin   |
+-------------------------------------------------+

Project dependencies are installing 

   debugPlugin.install completed in 895ms

+--------------------------------------------------+
| 7. Running preBuild lifecycle from debugPlugin   |
+--------------------------------------------------+

Prior to building the functions and running the build commands 

   debugPlugin.preBuild completed in 974ms

+---------------------------------------------------------------------------+
| 8. Running functionsBuild lifecycle from @netlify/plugin-functions-core   |
+---------------------------------------------------------------------------+

Zipping functions
Functions bundled in "C:\Users\ehmic\code\netlify-plugin-debug\.netlify\functions":
 - hello.zip

   @netlify/plugin-functions-core.functionsBuild completed in 1266ms

+--------------------------------------------------------+
| 9. Running functionsBuild lifecycle from debugPlugin   |
+--------------------------------------------------------+

Serverless functions are building, if they exist on the site 

   debugPlugin.functionsBuild completed in 1002ms

+-------------------------------------------------------------------------------------+
| 10. Running build lifecycle from build.lifecycle.build in netlify.yml config file   |
+-------------------------------------------------------------------------------------+

Running command "echo "hello world""
"hello world"

   build.lifecycle.build completed in 52ms

+------------------------------------------------+
| 11. Running build lifecycle from debugPlugin   |
+------------------------------------------------+

Build commands are executing ?

 v  debugPlugin.build completed in 950ms

+--------------------------------------------------+
| 12. Running package lifecycle from debugPlugin   |
+--------------------------------------------------+

Packaging site to be deployed 

   debugPlugin.package completed in 807ms

+----------------------------------------------------+
| 13. Running preDeploy lifecycle from debugPlugin   |
+----------------------------------------------------+

Prior to the built package being deployed 

   debugPlugin.preDeploy completed in 773ms

+----------------------------------------------------+
| 14. Running saveCache lifecycle from debugPlugin   |
+----------------------------------------------------+

Saving cached assets 

   debugPlugin.saveCache completed in 747ms

+-----------------------------------------------------------------------------------------+
| 15. Running finally lifecycle from build.lifecycle.finally in netlify.yml config file   |
+-----------------------------------------------------------------------------------------+

Running command "echo "Ending the build""
"Ending the build"

   build.lifecycle.finally completed in 41ms

+--------------------------------------------------+
| 16. Running finally lifecycle from debugPlugin   |
+--------------------------------------------------+

Site build finished, site deployed! 

   debugPlugin.finally completed in 728ms

+-----------------------------+
|   Netlify Build Complete!   |
+-----------------------------+

   Netlify Build completed in 13605ms

Have a nice day!

I seem to completely reproduce your environment, so I'm not sure why your output is different. Do you have an idea of something in our environments that might differ? Thanks.

@talves
Copy link
Author

talves commented Oct 28, 2019

I'm not using npx netlify build to run the command. I have the cli in dev deps. Let me do a new clone of the repository and see if something changes.

npx netlify build runs! Should it return to prompt after?

yarn run netlify build gives the error.

Since there is a reason and a solution, up to you if you want to support a local dev dependency install of the cli.

@ehmicky
Copy link
Contributor

ehmicky commented Oct 28, 2019

I'm not using npx netlify build to run the command. I have the cli in dev deps. Since there is a reason and a solution, up to you if you want to support a local dev dependency install of the cli.

Could you please explain what you mean by having the CLI in development dependencies? It seems to me this should not matter whether this is installed as a production or development dependency. On the other hand, what might matter is how the command is called. There are several ways: npx netlify build, yarn run netlify build, in the console vs using execa, programmatically in Node.js, etc.

yarn run netlify build gives the error.

Yes I can reproduce this. The bug is when combining Windows + Yarn. I have opened #387 to track this problem.

Should it return to prompt after?

It seems like npx netlify build currently hangs, which seems to be a separate issue with netlify/cli not netlify/build. I am going to look at that separate issue as well.

@talves
Copy link
Author

talves commented Oct 28, 2019

@ehmicky I have been using yarn so long I forgot that npx uses the local node_modules, so had not tried it 😢. My bad for not making it more clear. I only put the yarn version in original issue and did not give you the command I was using. Hope that did not add extra work for you.

@talves
Copy link
Author

talves commented Oct 28, 2019

Not sure if this helps, but thought I would mention it for your debugging.

Run npx netlify buils (bad command arg) and it will prompt you for the correct command arg; Choose build y as the option and the command does not hang.

@ehmicky
Copy link
Contributor

ehmicky commented Oct 28, 2019

I have been using yarn so long I forgot that npx uses the local node_modules, so had not tried it cry. My bad for not making it more clear. I only put the yarn version in original issue and did not give you the command I was using. Hope that did not add extra work for you.

No worries! :)

Run npx netlify buils (bad command arg) and it will prompt you for the correct command arg; Choose build y as the option and the command does not hang.

Thanks, that might help.

@ehmicky
Copy link
Contributor

ehmicky commented Oct 28, 2019

The yarn bug has been fixed by #388.

The CLI command hanging has not been fixed yet.

@ehmicky
Copy link
Contributor

ehmicky commented Oct 29, 2019

Everything mentioned in this issue has now been fixed in the latest version of @netlify/cli (2.20.1).

@ehmicky ehmicky closed this as completed Oct 29, 2019
@ehmicky ehmicky moved this from In progress to Done in Netlify Build Oct 29, 2019
@verythorough verythorough added type: bug code to address defects in shipped code and removed bug labels Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
No open projects
Netlify Build
  
Done
Development

No branches or pull requests

4 participants