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

Run instruction appears to be incorrect #1

Open
jeff303 opened this issue Feb 18, 2021 · 2 comments
Open

Run instruction appears to be incorrect #1

jeff303 opened this issue Feb 18, 2021 · 2 comments

Comments

@jeff303
Copy link

jeff303 commented Feb 18, 2021

In README.md, the instructions say to execute this to render the diagrams: node run build

However, at least on my system, this doesn't work.

node run build
node:internal/modules/cjs/loader:928
  throw err;
  ^

Error: Cannot find module '.../run'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

However, npm run build works:

npm run build

> [email protected] build
> node build.js

generating README at  generated/githubSequenceDiagrams/README.md
generating README at  generated/testFlowDiagram/README.md
generating README at  generated/testSequenceDiagram/README.md
Executing : ./node_modules/.bin/mmdc -i src/githubSequenceDiagrams/diagramFlow.mmd -o generated/githubSequenceDiagrams/diagramFlow.svg
Executing : ./node_modules/.bin/mmdc -i src/githubSequenceDiagrams/generationFlow.mmd -o generated/githubSequenceDiagrams/generationFlow.svg
Executing : ./node_modules/.bin/mmdc -i src/testFlowDiagram/flowDiagram.mmd -o generated/testFlowDiagram/flowDiagram.svg
Executing : ./node_modules/.bin/mmdc -i src/testSequenceDiagram/sequenceDiagram.mmd -o generated/testSequenceDiagram/sequenceDiagram.svg

This is on OS X 11.1, with:

node --version
v15.5.1
npm --version
7.3.0`
@CandidDisk
Copy link

Run instructions also don't work on my end. However, it's able to generate a README & crashes when generating the .svg file. Seems to be the same for npm run build

Output for node build run

mermaidJs>node build run
generating README at  generated\githubSequenceDiagrams/README.md
generating README at  generated\testFlowDiagram/README.md
Executing : ./node_modules/.bin/mmdc -i src\githubSequenceDiagrams\diagramFlow.mmd -o generated\githubSequenceDiagrams\diagramFlow.svg
'.' is not recognized as an internal or external command,
operable program or batch file.
child_process.js:655
    throw err;
    ^

Error: Command failed: ./node_modules/.bin/mmdc -i src\githubSequenceDiagrams\diagramFlow.mmd -o generated\githubSequenceDiagrams\diagramFlow.svg
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at mermaidJs\build.js:72:9
    at Array.forEach (<anonymous>)
    at generateSVGFiles (mermaidJs\build.js:70:24)
    at Object.<anonymous> (mermaidJs\build.js:81:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 7808,
  stdout: null,
  stderr: null
}

Output for npm run build

mermaidJs>npm run build

> [email protected] build mermaidJs
> node build.js

generating README at  generated\githubSequenceDiagrams/README.md
generating README at  generated\testFlowDiagram/README.md
Executing : ./node_modules/.bin/mmdc -i src\githubSequenceDiagrams\diagramFlow.mmd -o generated\githubSequenceDiagrams\diagramFlow.svg
'.' is not recognized as an internal or external command,
operable program or batch file.
child_process.js:655
    throw err;
    ^

Error: Command failed: ./node_modules/.bin/mmdc -i src\githubSequenceDiagrams\diagramFlow.mmd -o generated\githubSequenceDiagrams\diagramFlow.svg
    at checkExecSyncError (child_process.js:616:11)
    at execSync (child_process.js:652:15)
    at mermaidJs\build.js:72:9
    at Array.forEach (<anonymous>)
    at generateSVGFiles (mermaidJs\build.js:70:24)
    at Object.<anonymous> (mermaidJs\build.js:81:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 12700,
  stdout: null,
  stderr: null
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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!     AppData\Roaming\npm-cache\_logs\2021-03-10T05_23_31_109Z-debug.log ```

@CandidDisk
Copy link

Here is the log generated by npm

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 info lifecycle [email protected]~build: [email protected]
7 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build: PATH: REMOVED
9 verbose lifecycle [email protected]~build: CWD: mermaidJs
10 silly lifecycle [email protected]~build: Args: [ '/d /s /c', 'node build.js' ]
11 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
12 info lifecycle [email protected]~build: Failed to exec build script
13 verbose stack Error: [email protected] build: `node build.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd mermaidJs
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.16.0
19 verbose npm  v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `node build.js`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

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

2 participants