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

Getting yarn errors #16

Open
paulmeems-waterwatchfoundation opened this issue Feb 2, 2019 · 3 comments
Open

Getting yarn errors #16

paulmeems-waterwatchfoundation opened this issue Feb 2, 2019 · 3 comments

Comments

@paulmeems-waterwatchfoundation

It seems these tools are what I need to document my json schema: https://github.com/andrejellema/GlobalCoffeeDataStandard/blob/master/global-coffee-data-standard.schema.json

But I'm having major problems installing it. I'm getting a lot of yarn errors.

I'm using Win10 and I'm not familiar with yarn.
I also installed lerna, which is new to me too.

In my dev-folder everything seems to be ok:

D:\dev>yarn --version
1.13.0
D:\dev>lerna --version
3.10.7
D:\dev>node --version
v10.15.0

In the folder that holds my schema as well:

D:\dev\GlobalCoffeeDataStandard>yarn --version
1.13.0

But in the freshly cloned json-schema-tools schema I get this:

D:\dev\json-schema-tools>yarn --version
D:\dev\json-schema-tools\scripts\yarn\bin\yarn:2
argv0=$(echo "$0" | sed -e 's,\\,/,g')
        ^^^^

SyntaxError: missing ) after argument list
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)

The documentation says I should start with lerna bootstrap. That is giving these errors:

D:\dev\json-schema-tools>lerna bootstrap
lerna notice cli v3.10.7
lerna info versioning independent
lerna info bootstrap root only
D:\dev\json-schema-tools\scripts\yarn\bin\yarn:2
argv0=$(echo "$0" | sed -e 's,\\,/,g')
        ^^^^

SyntaxError: missing ) after argument list
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
lerna ERR! yarn install --mutex network:42424 --non-interactive exited 1 in '@cloudflare/json-schema-tools'
lerna ERR! yarn install --mutex network:42424 --non-interactive exited 1 in '@cloudflare/json-schema-tools'

When I remove the .yarnrc-file it seems to work:

D:\dev\json-schema-tools>lerna bootstrap
lerna notice cli v3.10.7
lerna info versioning independent
lerna info bootstrap root only
yarn install v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "workspace-aggregator-cc28e7f7-5fbb-42d4-b547-a3fafb988fd4 > @cloudflare/json-schema-apidoc-loader > [email protected]" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
[4/4] Building fresh packages...
Done in 11.82s.

I also can run doca init in my schema folder and the documentation folder is created and it contains several files.

I can also run

D:\dev\GlobalCoffeeDataStandard\git\documentation>yarn install
yarn install v1.13.0
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.35s.

But yarn start failes:

D:\dev\GlobalCoffeeDataStandard\git\documentation>yarn start
yarn run v1.13.0
$ node webpack/index | NODE_ENV=development node src/server
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 255.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

D:\dev\GlobalCoffeeDataStandard\git\documentation>× 「wdm」: Hash: 1528029a029c0dd52815
Version: webpack 3.12.0
Time: 1417ms
 Asset    Size  Chunks                    Chunk Names
app.js  3.7 MB       0  [emitted]  [big]  app
  [14] ./node_modules/react/react.js 56 bytes {0} [built]
  [33] (webpack)/buildin/module.js 517 bytes {0} [built]
  [92] ./node_modules/react-dom/index.js 59 bytes {0} [built]
 [118] ./node_modules/react-redux/es/index.js 229 bytes {0} [built]
 [158] multi webpack-hot-middleware/client?path=http://192.168.1.149:8080/__webpack_hmr ./src/client/index.js 40 bytes {0} [built]
 [159] (webpack)-hot-middleware/client.js?path=http://192.168.1.149:8080/__webpack_hmr 7.77 kB {0} [built]
 [160] ./node_modules/querystring-es3/index.js 127 bytes {0} [built]
 [163] ./node_modules/strip-ansi/index.js 161 bytes {0} [built]
 [165] (webpack)-hot-middleware/client-overlay.js 2.21 kB {0} [built]
 [170] (webpack)-hot-middleware/process-update.js 4.37 kB {0} [built]
 [171] ./src/client/index.js 710 bytes {0} [built]
 [271] ./node_modules/react-redux/es/components/Provider.js 2.17 kB {0} [built]
 [299] ./src/client/main.js 1.27 kB {0} [built]
 [425] ./node_modules/@cloudflare/doca-default-theme/styles \.less$/ 160 bytes {0} [optional] [built]
 [427] ./src/client/store.js 1.42 kB {0} [built]
    + 416 hidden modules

ERROR in ./getting-started.json
Module build failed: Error: Cannot find module '@cloudflare/json-hyper-schema'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (D:\dev\GlobalCoffeeDataStandard\git\documentation\node_modules\@cloudflare\json-schema-transform\lib\example.js:2:18)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .js] (D:\dev\GlobalCoffeeDataStandard\git\documentation\node_modules\babel-register\lib\node.js:152:7)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
 @ ./schemas.js 14:0-33
 @ ./src/client/store.js
 @ ./src/client/index.js
 @ multi webpack-hot-middleware/client?path=http://192.168.1.149:8080/__webpack_hmr ./src/client/index.js

After hours of trying I give up. Please assist me on how to run doca.

@zhangyongjing
Copy link

zhangyongjing commented Jun 10, 2019

I had the same problems with win10.

Here is some advice for you:

  1. Please try to escape the quote mark as follows:
    argv0=$(echo ""$0"" | sed -e 's,\,/,g')

  2. Then refer to issue#5 to solve other problems. Good luck!

@bertiepinnock
Copy link

I know this was a while ago but the above didn't work for me, so for anyone else who is running into Windows issues and isn't familiar with Yarn, I managed to get it working another way.

The repository is configured to use a particular (included) distribution of Yarn. My assumption is that this distribution is for *nix systems which is why attempting to run it on Windows doesn't work.

If you remove the reference to the included Yarn distribution from the repository ".yarnrc" file then your system Yarn installation will be used instead which seems to work fine for the version I'm using (1.22.4).

@vnenkpet
Copy link

vnenkpet commented Feb 9, 2021

I am having the same problem on mac

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

4 participants