mdaines / grammophone

A tool for analyzing and transforming context-free grammars.
https://mdaines.github.io/grammophone
MIT License
200 stars 23 forks source link

npm ERR!A subdirectory or file -p already exists. #3

Closed evandrocoan closed 6 years ago

evandrocoan commented 6 years ago
sh-4.4$ yarn run watch
yarn run v1.5.1
warning package.json: No license field
$ npm-run-all --parallel watch-src watch-styles

> @ watch-src D:\grammophone
> mkdir -p dist && watchify src/application.js -o dist/application.js --standalone ApplicationController --transform ejsify --transform [ babelify --ignore parser.js --presets [ es2015 ] ]

A subdirectory or file dist already exists.
Error occurred while processing: dist.

> @ watch-styles D:\grammophone
> mkdir -p dist && node-sass --watch styles/application.scss dist/application.css

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR!A subdirectory or file -p already exists.
Error occurred while processing: -p.
 @ watch-src: `mkdir -p dist && watchify src/application.js -o dist/application.js --standalone ApplicationController --transform ejsify --transform [ babelify --ignore parser.js --presets [ es2015 ] ]`
A subdirectory or file dist already exists.
npmError occurred while processing: dist.
 ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch-src script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm
npm  ERR!ERR! A complete log of this run can be found in:
 npmcode  ELIFECYCLE
ERR!     C:\Users\Professional\AppData\Roaming\npm-cache\_logs\2018-03-13T18_51_51_730Z-debug.log
npm ERR! errno 1
npm ERR! @ watch-styles: `mkdir -p dist && node-sass --watch styles/application.scss dist/application.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch-styles script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Professional\AppData\Roaming\npm-cache\_logs\2018-03-13T18_51_51_844Z-debug.log
ERROR: "watch-src" exited with 1.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: C:\\Windows\\system32\\cmd.exe
Arguments: /d /s /c npm-run-all --parallel watch-src watch-styles
Directory: D:\\User\\GoogleDrive\\Semestres_Arquivados\\INE5421_Formais\\grammophone
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "D:\\User\\GoogleDrive\\Semestres_Arquivados\\INE5421_Formais\\grammophone\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

2018-03-13T18_51_51_844Z-debug.log

Running the Unit Tests is OK:

sh-4.4$ yarn test
yarn run v1.5.1
warning package.json: No license field
$ mocha "test/**/*-test.js"

  Classification
    √ should agree with smlweb (525ms)

  Nonterminals
    √ should calculate first sets
    √ should calculate follow sets
    √ should calculate nullable nonterminals

  Parsing
    √ should parse basic grammars
    √ should parse variations in spacing
    √ should accept certain non-letter characters as symbols
    √ should parse multiple lines
    √ should ignore comments
    √ should correctly emit parse errors

  Sanity
    √ should identify unreachable nonterminals
    √ should identify unrealizable nonterminals
    √ should identify cycles
    √ should identify null ambiguity
    √ should identify a sentence with an ambiguous derivation

  Transformations
    √ should expand nonterminals

  16 passing (654ms)

Done in 2.93s.
sh-4.4$
mdaines commented 6 years ago

I assume based on the “D:\” in the path that you are using Windows? I’m not too familiar with that, but I suppose the “-p” option doesn’t have the same effect as other platforms.

evandrocoan commented 6 years ago

Yes. I managed to build it using the Windows Subsystem for Linux https://docs.microsoft.com/en-us/windows/wsl/about

I had to run all the 3 commands in order to make it run smoothly on my local computer:

yarn install &&
yarn run dist &&
yarn run generate-parser

Then I could just open index.html and it worked.