pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Cannot package a node app

Open sakthibn opened this issue 7 years ago • 6 comments

I am getting this error when I am running pkg index.js TypeError: Expected cwd to be of type string but received type undefined at module.exports.sync (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\dir-glob\index.js:56:9) at globDirs (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\globby\index.js:58:9) at getPattern (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\globby\index.js:61:64) at globTasks.reduce (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\globby\index.js:107:19) at Array.reduce () at Function.module.exports.sync (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\globby\index.js:106:26) at collect (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\lib-es5\walker.js:145:27) at expandFiles (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\lib-es5\walker.js:152:9) at Walker._callee$ (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\lib-es5\walker.js:215:27) at tryCatch (C:\Users\sakthivelbn\AppData\Roaming\npm\node_modules\pkg\node_modules\regenerator-runtime\runtime.js:62:40)

sakthibn avatar Jan 10 '19 10:01 sakthibn

I have the same error. OS: Ubuntu 18.04 Node.js 11, latest pkg version. I also tried v. 4.3.0

Error! TypeError: Expected cwd to be of type string but received type undefined at module.exports.sync (/home/userr/.local/lib/node_modules/pkg/node_modules/dir-glob/index.js:56:9) at globDirs (/home/userr/.local/lib/node_modules/pkg/node_modules/globby/index.js:58:9) at getPattern (/home/userr/.local/lib/node_modules/pkg/node_modules/globby/index.js:61:64) at globTasks.reduce (/home/userr/.local/lib/node_modules/pkg/node_modules/globby/index.js:107:19) at Array.reduce () at Function.module.exports.sync (/home/userr/.local/lib/node_modules/pkg/node_modules/globby/index.js:106:26) at collect (/home/userr/.local/lib/node_modules/pkg/lib-es5/walker.js:145:27) at expandFiles (/home/userr/.local/lib/node_modules/pkg/lib-es5/walker.js:152:9) at Walker._callee$ (/home/userr/.local/lib/node_modules/pkg/lib-es5/walker.js:215:27) at tryCatch (/home/userr/.local/lib/node_modules/pkg/node_modules/regenerator-runtime/runtime.js:62:40)

rytai avatar Jan 10 '19 11:01 rytai

Also same issue with OS: Raspbian GNU/Linux 9 (stretch).

`> [email protected]

Error! TypeError: Expected cwd to be of type string but received type undefined at module.exports.sync (/usr/lib/node_modules/pkg/node_modules/dir-glob/index.js:56:9) at globDirs (/usr/lib/node_modules/pkg/node_modules/globby/index.js:58:9) at getPattern (/usr/lib/node_modules/pkg/node_modules/globby/index.js:61:64) at globTasks.reduce (/usr/lib/node_modules/pkg/node_modules/globby/index.js:107:19) at Array.reduce () at Function.module.exports.sync (/usr/lib/node_modules/pkg/node_modules/globby/index.js:106:26) at collect (/usr/lib/node_modules/pkg/lib-es5/walker.js:145:27) at expandFiles (/usr/lib/node_modules/pkg/lib-es5/walker.js:152:9) at Walker._callee$ (/usr/lib/node_modules/pkg/lib-es5/walker.js:375:25) at tryCatch (/usr/lib/node_modules/pkg/node_modules/regenerator-runtime/runtime.js:62:40)`

Attempted to downgrade with
npm install -g [email protected]
but was unable to downgrade.

Controlhaus avatar Jan 10 '19 11:01 Controlhaus

#603

Jullekungfu avatar Jan 10 '19 11:01 Jullekungfu

Same on mac os.

A avatar Jan 10 '19 14:01 A

npm install -g https://github.com/randallknutson/pkg.git#build
and a reboot worked for me

Controlhaus avatar Jan 10 '19 14:01 Controlhaus

Fixed in [email protected]. Thanks!

igorklopov avatar Jan 10 '19 18:01 igorklopov