tmcw / docbox

REST API documentation generator
ISC License
1.14k stars 191 forks source link

Issue with node 6.0.0 #13

Closed JamesChevalier closed 8 years ago

JamesChevalier commented 8 years ago

I tried out npm run build with node version 6.0.0 (npm version 3.8.7, I believe) and it produced the error below. I haven't had a chance to debug it, yet - sorry!

> docbox@1.0.0 build /path/to/docbox
> NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html

TypeError: Path must be a string. Received undefined while parsing file: /path/to/docbox/src/index.js
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at /path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:353:36
    at /path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:375:22
    at Array.map (native)
    at OptionManager.resolvePresets (/path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
    at OptionManager.mergePresets (/path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
    at OptionManager.mergeOptions (/path/to/docbox/node_modules/babel-core/l
> docbox@1.0.0 prerender /path/to/docbox
> babel src --out-dir lib && node lib/render.js "index.html"

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at /path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:353:36
    at /path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:375:22
    at Array.map (native)
    at OptionManager.resolvePresets (/path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:20)
    at OptionManager.mergePresets (/path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:348:10)
    at OptionManager.mergeOptions (/path/to/docbox/node_modules/babel-core/lib/transformation/file/options/option-manager.js:307:14)
    at /Users/me/Documents/
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/me/n/bin/node" "/Users/me/n/bin/npm" "run" "prerender" "--" "index.html"
npm ERR! node v6.0.0
npm ERR! npm  v3.8.7
npm ERR! code ELIFECYCLE
npm ERR! docbox@1.0.0 prerender: `babel src --out-dir lib && node lib/render.js "index.html"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the docbox@1.0.0 prerender script 'babel src --out-dir lib && node lib/render.js "index.html"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the docbox package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel src --out-dir lib && node lib/render.js "index.html"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs docbox
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls docbox
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /path/to/docbox/npm-debug.log

npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/me/n/bin/node" "/Users/me/n/bin/npm" "run" "build"
npm ERR! node v6.0.0
npm ERR! npm  v3.8.7
npm ERR! code ELIFECYCLE
npm ERR! docbox@1.0.0 build: `NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the docbox@1.0.0 build script 'NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the docbox package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs docbox
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls docbox
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /path/to/docbox/npm-debug.log
tmcw commented 8 years ago

Ooof, bracing for the impact of more node 6 issues :) Thx for the report, will take a look.

jingsam commented 8 years ago

Node 6.0 is unstable. Many packages run well in 5.0 but error in 6.0

JamesChevalier commented 8 years ago

I just realized I hadn't included the npm-debug.log file like the output requested.

Here's that /path/to/docbox/npm-debug.log file - this is with node 6.1.0 & npm 3.8.9 now (looks to be the same issue, though):

0 info it worked if it ends with ok
1 verbose cli [ '/Users/me/n/bin/node',
1 verbose cli   '/Users/me/n/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@3.8.9
3 info using node@v6.1.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle docbox@1.0.0~prebuild: docbox@1.0.0
6 silly lifecycle docbox@1.0.0~prebuild: no script for prebuild, continuing
7 info lifecycle docbox@1.0.0~build: docbox@1.0.0
8 verbose lifecycle docbox@1.0.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle docbox@1.0.0~build: PATH: /Users/me/n/lib/node_modules/npm/bin/node-gyp-bin:/path/to/docbox/node_modules/.bin:/Users/me/n/bin:/Users/me/.rvm/gems/ruby-2.3.0@gemset/bin:/Users/me/.rvm/gems/ruby-2.3.0@global/bin:/Users/me/.rvm/rubies/ruby-2.3.0/bin:/Users/me/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/Users/me/n/bin
10 verbose lifecycle docbox@1.0.0~build: CWD: /path/to/docbox
11 silly lifecycle docbox@1.0.0~build: Args: [ '-c',
11 silly lifecycle   'NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html' ]
12 silly lifecycle docbox@1.0.0~build: Returned: code: 1  signal: null
13 info lifecycle docbox@1.0.0~build: Failed to exec build script
14 verbose stack Error: docbox@1.0.0 build: `NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/Users/me/n/lib/node_modules/npm/lib/utils/lifecycle.js:245:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/Users/me/n/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:850:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid docbox@1.0.0
16 verbose cwd /path/to/docbox
17 error Darwin 14.5.0
18 error argv "/Users/me/n/bin/node" "/Users/me/n/bin/npm" "run" "build"
19 error node v6.1.0
20 error npm  v3.8.9
21 error code ELIFECYCLE
22 error docbox@1.0.0 build: `NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html`
22 error Exit status 1
23 error Failed at the docbox@1.0.0 build script 'NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the docbox package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs docbox
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls docbox
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
catamphetamine commented 8 years ago

Had the same issue, just update babel-core

npm install babel-core@latest

tmcw commented 8 years ago

Okay, going to bump a few dependencies to hopefully get back on the node 6 train.

shayneo commented 7 years ago

something like this popped up for me too, tried updating babel-core but that didn't do the trick

src/render.js -> lib/render.js
/path/to/docbox/lib/custom/index.js:39
  return str.replace(/{[\w_]+}/g, function (str) {
            ^

TypeError: Cannot read property 'replace' of undefined
    at highlightTokens (/path/to/docbox/lib/custom/index.js:39:13)
    at module.exports.transformURL (/path/to/docbox/lib/custom/index.js:57:224)
    at /path/to/docbox/lib/components/content.js:69:47
    at Array.forEach (native)
    at /path/to/docbox/lib/components/content.js:58:11
    at Array.map (native)
    at chunkifyAST (/path/to/docbox/lib/components/content.js:48:6)
    at render (/path/to/docbox/lib/components/content.js:115:7)
    at /path/to/docbox/node_modules/react-dom/lib/ReactCompositeComponent.js:796:21
    at measureLifeCyclePerf (/path/to/docbox/node_modules/react-dom/lib/ReactCompositeComponent.js:75:12)

npm ERR!     babel src --out-dir lib && node lib/render.js "index.html"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs docbox
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls docbox
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /path/to/docbox/npm-debug.log

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.9.2
npm ERR! npm  v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! docbox@1.0.2 build: `NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the docbox@1.0.2 build script 'NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the docbox package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs docbox
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls docbox
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /path/to/docbox/npm-debug.log

also, debug log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm@4.1.1
3 info using node@v6.9.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle docbox@1.0.2~prebuild: docbox@1.0.2
6 silly lifecycle docbox@1.0.2~prebuild: no script for prebuild, continuing
7 info lifecycle docbox@1.0.2~build: docbox@1.0.2
8 verbose lifecycle docbox@1.0.2~build: unsafe-perm in lifecycle true
9 verbose lifecycle docbox@1.0.2~build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/path/to/docbox/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle docbox@1.0.2~build: CWD: /path/to/docbox
11 silly lifecycle docbox@1.0.2~build: Args: [ '-c',
11 silly lifecycle   'NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html' ]
12 silly lifecycle docbox@1.0.2~build: Returned: code: 1  signal: null
13 info lifecycle docbox@1.0.2~build: Failed to exec build script
14 verbose stack Error: docbox@1.0.2 build: `NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid docbox@1.0.2
16 verbose cwd /path/to/docbox
17 error Darwin 16.4.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
19 error node v6.9.2
20 error npm  v4.1.1
21 error code ELIFECYCLE
22 error docbox@1.0.2 build: `NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html`
22 error Exit status 1
23 error Failed at the docbox@1.0.2 build script 'NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the docbox package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     NODE_ENV=production browserify src/index.js | uglifyjs -c -m > bundle.js && npm run prerender -- index.html
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs docbox
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls docbox
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
tmcw commented 7 years ago

@shayneo That's a different problem. Mind opening an issue with that error report and a snippet of the markdown input you're sending as input?