Mock-Routing again :P (Windows)

This one again :stuck_out_tongue: Tried to post in the old topic below but it looks closed?

Trying to get it working with Alpha 2, but it’s giving an issue with NODE_ENV=dev yarn and I just installed Node 6.5.0 on my machine.

Have tried a few different ways, like node NODE_ENV=dev yarn and yarn NODE_ENV=dev and run NODE_ENV=dev etc etc. No luck

Any thoughts? Thanks!

Right, in Windows PowerShell you’ll need to run $env:NODE_ENV = "dev", then run yarn.

This environment variable will only be set for that shell session.

In command prompt you may be able to use set NODE_ENV=dev, but I’m not sure because I typically use PowerShell.

You can verify that the variable is set by running Get-ChildItem Env: and looking for it in the list.

1 Like

Thanks for that!

I think I might have also solved part of it too, by just running yarn like usual first, and then doing NODE_ENV=dev yarn

I didn’t do that originally because it says “Instead” here, so I thought it meant to skip yarn and go straight to the NODE_ENV one.

Should we clear that up in the safe_browser README? “Also” or “additionally” might be a better word to use there, than “instead”

Back to that big giant “Javascript error” screen, that we’ve grown accustomed to over the years :stuck_out_tongue:

Do you have a precompiled mock-routing version for Alpha 2 that I could have?

I’ll do my best to distribute it to everyone who needs it again, in another public repo, and I’ll add in some apps again for everyone. Thanks!

With as much time as you spend working on development, it would be worth your time to work through these errors, thus making you more independent.

  • Open a PowerShell window
  • Navigate to desired path using cd
  • In PowerShell command line, run $env:NODE_ENV = "dev"
  • Most likely you’ll need to run yarn config set child-concurrency 1 (just for Windows for anyone else reading this)
  • Run yarn
  • Run yarn run build
  • Run yarn run package

I’m updating readme file today.

When you run into errors either paste them into a post for me to see or a snapshot of the error screen so that I have information to help you debug.

1 Like

Hey so I’m trying it on Linux now too, as that seems to give fewer problems in the past.

I’ve tried a few things, after cloning safe_browser and cd’ing into it, but they all give errors. Here are all my attempts, and the errors that follow:

NODE_ENV = “dev”
NODE_ENV: command not found

$env:NODE_ENV = “dev”
:NODE_ENV: command not found
(understandable, as I guess that was a Windows only powershell command)

yarn NODE_ENV = “dev”
ERROR: [Errno 2] No such file or directory: ‘NODE_ENV’

NODE_ENV = “dev” yarn
NODE_ENV: command not found

yarn
ERROR: There are no scenarios; must have at least one.

yarn NODE_ENV=dev
ERROR: [Errno 2] No such file or directory: ‘NODE_ENV=dev’

NODE_ENV=dev yarn
ERROR: There are no scenarios; must have at least one.

and lots of other similar attempts that all return the same error.

I installed node 6.5.0 with nvm 0.33.6 (& yarn version 0.27)

Also

Are the correct steps:

  1. git clone …
  2. cd …
  3. yarn
  4. yarn NODE_ENV = “dev”

Are those the correct steps? because the readme is a bit confusing on if I should do step 3 or not, when trying to get a dev version

That could be the problem. Can you try with node version 7.10.0 please?

1 Like

Thanks for the help, it was this part of the current Github ReadMe that I was following. Have v7.10.0 now but it’s still not working as expected:

node --version
v7.10.0

yarn
ERROR: There are no scenarios; must have at least one.

Thanks :slight_smile:

thanks everyone for the mock builds, have messaged you guys.

Great community! Thanks for bearing with me. Will compensate with some coin and also with some cool new content in the future!

Yes, the readme must be updated.

For one last time can you try removing the node_modules from root folder and also from the app folder.

Then set node_env to dev and try running ‘npm install && npm run rebuild && npm run build && npm run package’.

We will be able to indentify which command is failing. I suspect node-gyp could be the issue at the rebuild step.

It appears that this thread, ERROR: There are no scenarios; must have at least one. · Issue #2821 · yarnpkg/yarn · GitHub, addresses why NODE_ENV=dev yarn is not working for you. Ubuntu may come installed with a different program called cmdtest which conflicts with yarn.
You may need to apt-get remove cmdtest to get the expected yarn program to execute.

Back to Windows, I want to make sure that the steps are clear for building mock. See updated readme: sn_browser/README.md at master · maidsafe/sn_browser · GitHub

  • clone repo
  • cd into directory
  • Run $env:NODE_ENV = "dev", do not run yarn first when building for mock
  • Then run yarn
  • yarn run build
  • yarn run package
2 Likes