nos / create-nos-dapp

CLI tool to generate a new nOS dApp
53 stars 35 forks source link

New dApp failed to build with stand-alone file structure #28

Closed jaszhou closed 6 years ago

jaszhou commented 6 years ago

I've created a new dApp with create-nos-dapp called hot-tokens. The file structure look like this:

create-nos-dapp/hot-token

I'm able to build the new dApp if I run yarn install/start under directory:

create-nos-dapp/hot-token.

The problem happens when I try to move the folder of hot-token out of create-nos-dapp folder. When I run yarn install/start, it compains with the follow error:

.../hottokens/src/views/App/index.jsx:52:18: Unexpected token (5  50 |   }
  51 | 
> 52 |   getInitialState = () => {
     |                   ^
  53 | 
  54 |     return {
  55 |       playerAddress: "",

It looks like yarn failed to build javascript in ES6.

The command I tried:

 mkdir hottokens
 cp -R hot-tokens/hot-tokens/* hottokens/
 cd hottokens/
  yarn install
  yarn start

Expected Behavior

The project should be able to build in its own location

Current Behavior

The project can be built successfully under create-nos-dapp/hot-token, but failed if moved location.

Possible Solution

Steps to Reproduce (for bugs)

The command I tried:

 mkdir hottokens
 cp -R hot-tokens/hot-tokens/* hottokens/
 cd hottokens/
  yarn install
  yarn start

Context

At the moment, I have to submit the project to github with the parent folder as a workaround

e.g.

https://github.com/jaszhou/hot-tokens/hot-tokens

It should be a cleaner way.

Your Environment

yarn 1.7.0 node 8.11.3 npm 5.6.0

MacOS 10.13.4

mhuggins commented 6 years ago

From your description, it sounds like you did not install create-nos-dapp globally before creating your dapp. Your dapp should not have been under a create-nos-dapp folder. Take a look at the installation portion of the readme to see how to install globally.

Hope this helps!

jaszhou commented 6 years ago

@mhuggins Thanks for the suggestion! It solved my problem!